Red Echo

July 16, 2010

Performance tonight

I will be performing tonight as part of a semi-weekly club night called Tryst, at the Little Red Studio in South Lake Union. Tryst has has drawn some of Seattle’s best DJs, and I am excited about the opportunity to play. I’ll be doing a live-PA set in the downtempo room starting at 12 AM… love to see you there :-)

Guerrilla guide to CNC machining and resin casting:

Several years ago, I took a leap of faith, and decided to learn all there is to benchtop CNC manufacturing, the hard way. I spent a good amount of money to set things up without any sort of an assurance it would actually work the way I hoped, then went through months on trial-and-error experiments with dozens of different materials and processes. It was well worth it, to be sure: today, I can use this awesome tool with confidence, and get results I’m often proud of. I do not see a reason why the learning curve needs to be as punishing for others – and for this reason, I decided to put together this document. My hope is that it will help you decide whether CNC milling is right for you, and give you the head start needed if the answer is “yes”.

July 15, 2010

Newbie guide to Eagle and PCB manufacture, walking you through the steps involved in getting an Arduino plug-in “shield” made.

July 14, 2010

There’s been an interesting trend toward “open-source hardware” over the last few years, as the growth of the quick-turn manufacturing industry, the increasing power of cheap microcontrollers, and the wide accessibility of CAM devices like laser cutters have run into a hobbyist culture long familiar with open-source software and creative commons licensing. You can’t clone hardware for nearly zero cost, like you can with software, but it is increasingly easy to see hardware as a physical representation of some digitally-encoded design. As the capital investment required to manufacture such a design continues to drop, and more people gain access to such processes, it makes increasing sense to start sharing around the knowledge necessary to design and build one’s own devices.

In this context, the newly proposed Open Source Hardware License is particularly interesting, as an attempt to do for hardware something like the OSI did when it first standardized the term “open source”. There are already a number of small shops selling both kits and assembled devices for which they also freely publish the schematics and firmware source; the Arduino has become the most popular microcontroller platform in the hobbyist community in no small part because of the vast array of completely legal clones which have jumped on the bandwagon.

I’ve been toying with the idea of commercializing the rhythm robot, possibly as a kit, or perhaps a fully assembled device like you might find in Guitar Center. Now I’m thinking: what if I added a USB port for a programming interface, published the schematics, and gave away the firmware? Most people would probably just play with it as-is, but people who were really interested could dig in and customize it, or even build their own variations. How cool would that be?

I took Holly M.’s yoga class on Sunday, and my thigh muscles are still distinctly sore. I continue to believe that this form of exercise is going to be good for me, but like many other things that are good for a person, it is neither easy nor comfortable. It’s hard to pin down, though; I feel solidly wrung out afterward, but without feeling like I’ve actually done much of anything: there are no weights, no treadmills, nothing to lift or push or strain against; there is just a lot of stretching and positioning, and yet somehow it’s a lot of work.

Ava’s response is totally different: she loves it, she loves the way it makes her feel, and she goes several times a week with no apparent consequences. I’m sure that most of that is just because she has accustomed herself to it, but she seems to genuinely get a lot of pleasure out of it; where for me it is more like preventative maintenance for my body. It feels good to know I am taking care of myself, but I don’t get the same direct enjoyment she does.

July 12, 2010

One of the great things about writing firmware is that sometimes, the bug really is in the hardware.

July 9, 2010

Barry & Maja’s Wedding

I spent the weekend out on John & Holly M.’s property in Eastern Washington, where Barry & Maja threw a big weekend-long party for their wedding. It was really nice. You can tell how much love and respect their friends have for them by the immense amount of work that went into the whole production. All the cooking, decoration, performance, music, and the rest of it was done by volunteers, and the result was the most gorgeous, friendly, and satisfying music festival type event I’ve ever attended.

Michael H. did the ceremony, and every word of it had clearly been thought out and meant from the heart; it was completely consistent with the kind of people Barry & Maja are.

The weather was good, and the sunset Sunday after the ceremony was unbelievably spectacular – wispy clouds breaking up, swirling, reforming at ten times the normal rate, glowing from inside as the sun sank beneath the horizon. Then we stayed up all night, with music and bonfires and costumes, and lots and lots of colorful LED lights.

I got a lot of compliments on the path lanterns and bloom lights, and many people asked me to let them know next time so they could help out! It was really satisfying to see all of the lights together. It has meant a lot to me to do this project, and being able to surprise everyone with something beautiful and unique made me feel like I have finally gotten my creative mojo back. I felt really good, like I was part of it all again. I’ve missed it.

Sparkfun just linked to Ponoko, a laser-cutting service with an impressive array of materials on offer: in addition to the usual acrylic, delrin, and plywood, they offer felt, leather, bamboo, a variety of veneers, and even cork! (Oddly, their FAQ page talks about metal cutting, but their materials page does not list any metals.) Quickturn manufacturing shops have been around for a good while now but this one is more like a meta-shop: Ponoko runs account management, billing, and the web front-end, and farms the actual fabrication out to one of several “hubs.”

The success of the rhythm robot project got me really excited about making DJ gear, and I have ideas for half a dozen additional devices, along with some vague plans for possible future commercialization. Two of the gadgets need to do a lot of audio processing: one is a specialized percussion synthesizer, and the other is a multiband/multichannel compressor. I’ve been reading up on filters, oscillators, op-amps, and the like, and I think both of these projects could reasonably be done with a simple microcontroller driving an array of analog audio hardware, but I keep coming back to the fact that I’m basically a software guy building hardware in my free time. I don’t really want to spend weeks soldering up RC networks: especially not when I could just get a faster processor and do it all in code, which is cheap and easy to fix. So, I’m looking into 32-bit microcontrollers, and the most interesting line so far seems to be the ARM Cortex-M3.

Here are a few Arduino-style dev boards based on the ARM Cortex-M3:

  • Maple: 72 MHz, general USB, IDE based on Arduino, $50
  • Cortino: several models, 36-72 MHz, serial USB, no IDE (use gcc), $40-$70
  • ARMmite Pro: 60 MHz, no USB, Coridium IDE, $30

July 7, 2010

Here are some LED indicator rings like the ones on the Nord Lead 3. The really terrific thing about this design, using LEDs instead of a physical indicator, is that you can change parameters in software without leaving a knob pointing in the wrong direction.

July 6, 2010

Creating simple sound gadgets using basic logic circuits: oscillators, arpeggiators, envelope generators, and the like, using nothing but a hex inverter, a binary counter, and an 8-channel multiplexer.

July 3, 2010

With Ava on North Dome


June 27, 2010

Done with the bloom lights!

I got cracking on the bloom light firmware Friday evening, thinking with my usual optimism that I’d be done by one or two. Things happened, and there were problems, and I solved them, and it was 5:30 AM when I finally went to bed.

The part I’m happiest with is the HSV-to-hexachrome algorithm. HSV (and HSL) are basically alternate representations for what is fundamentally an RGB color space, and all the descriptions and code samples available discuss the conversion from HSV to RGB and back. The bloom lights do include red, green, and blue channels, but they also have orange, yellow, and purple. I was sure that there was some way to generalize the transformation so I could use six channels instead of three, but I found no references to anyone having done such a thing before, and certainly no code samples or theoretical explanations that might help me understand how it might be done.

I ended up starting from scratch and working out a general way to map a color in the HSV space onto an arbitrary point on the color spectrum, yielding a power level. (This differs from the standard algorithm’s approach, which computes three values, then assigns them to either R, G, or B depending on the hue position.) Transforming HSV to ROYGBV is simply a matter of computing this formula once per channel – this would work just as well for RYGB or any other combination of wavelengths.

Given this platform, the animation algorithm computes a series of evolving waveforms; the architecture is of course reminiscent of Starfish (or more precisely its animation-oriented descendant Cuttlefish). Each light’s activity level ebbs and flows; it’ll make subtle shifts, building up to a frenzy of activity, then settle back down again into some new state.

There was a fair bit of additional finish work to do, which I tackled in small bursts between other errands, and I finally dropped off the completed bloom lights at ten last night. It feels great to have them done – and it’s not even July! I usually spend July and August in a frenzy of activity, trying to finish up whatever my year’s big art project is going to be… but this year, since I’m skipping Burning Man, I’m done early. I wonder what a normal summer is like?

p.s. Sorry, I don’t have any pictures. I was in too much of a rush. I’ll have some pictures after next weekend, since they’ll be on display as part of Eva’s flowers project at Barry & Maja’s wedding.

I mentioned I’d been looking into AC light dimming. Here’s a Velleman kit that offers DC voltage-controlled dimming. The input is 0-10V, so I’d have to rig up an op-amp to drive it from a microcontroller, but that shouldn’t be too hard. One feature I very particularly like is the inclusion of an opto-isolator, so there is no direct electrical connection between the controller and the AC line power.

June 25, 2010

It’s twelve years old, but this Evaluation of Modern Sound Synthesis Methods from Helsinki University is admirably complete. The math is a little thick for my taste, but perhaps I’ll be able to dig through some of it.

June 24, 2010

I spent several hours last night working on the firmware for the bloom lights. I quickly ran into a strange, frustrating problem: every attempt at smooth animation rapidly became choppy, lights flickering and stuttering. I found some demo programs for the TLC5940 LED-controller chips, and they ran perfectly. I disabled one of the two chips, driving only 16 channels, and that ran perfectly. I dug through the driver, wrote a simple bit-bang replacement, quickly ran into the same problem: what??

Several hours of debugging later, the problem turned out to be purely analog. The bloom light has 120 LEDs divided into 30 channels, each drawing 20 milliamps: that is, 600 milliamps altogether. The control circuit runs at 5V, regulated down from 12V by an LM7805. And…. the power supply is a plain ol’ wall-wart, rated for 1 amp. So I’m just drawing more power than it wants to supply, and the voltage is dropping, and havoc ensues.

Ok. New 4-amp 12V supply on the way. Ridiculous LED illumination will be mine! Muahahaha.

[p.s.: 4-amp supply applied. Smooth, beautiful LED fading resulted. Yeah!]

June 21, 2010

I decided to decorate my new desk. It has a dark grey metal screen around the back, and I thought it would look cool to shine some LEDs up there. I got half a dozen red LEDs, standard 5mm type, a 150-ohm resistor for each, an Arduino pro mini, and a tiny plastic housing. A little soldering and wiring later, and I had my gadget. I’ve spaced the LEDs evenly along the back of my desk, held on to the metal screen with binder clips. There is enough ambient light here that they don’t illuminate the screen quite as much as I’d hoped, but they still look cool, and it’s probably better not to make them too distracting anyway.

The first comment I got was “Looks cool! Next step RGB!”, which snapped my ego just a tiny little bit. No, really, I wanted to say, I could do full 24-bit color if I wanted to! Really! I’ve done it before! This whole “warm steady red” thing was an artistic choice! Er. Oh well, I like it.


// six-way LED fader for arduino

struct light_t {
  int pin;
  unsigned long startTime;
  unsigned long period;
};

static const int kLights = 6;
static light_t light[kLights] = {
  {3, 0, 0},
  {5, 0, 0},
  {6, 0, 0},
  {9, 0, 0},
  {10, 0, 0},
  {11, 0, 0}
};

const int kMinPeriod = 4000;
const int kMaxPeriod = 32000;

unsigned long randomPeriod()
{
  return random(kMinPeriod, kMaxPeriod);
}

float curve(float val)
{
  // The apparent LED brightness should follow something like
  // a bell curve: starting at zero, swelling up to 1.0 at 
  // the halfway point, then diminishing back to 0. We'll do
  // this by mapping the input range over 2Ï€, then inverting
  // a cosine wave and compressing it into our output range.
  float curvemap = (1.0 - cos(val * 6.2831853071796)) / 2.0;
  // Gamma-correct the value: optimal curve would be 2.2, but
  // we can much more cheaply calculate ^2
  return curvemap * curvemap;
}

void setup()
{
  // Analog pin 0 is not connected to anything, so it will
  // return some unpredictable noise. We will sample its
  // starting value as our PRNG seed, guaranteeing that
  // we get a different animation sequence each power-up.
  randomSeed(analogRead(0));

  // Pick a random starting period for each light.
  for (int i = 0; i < kLights; i++) {
    light[i].period = randomPeriod();
  }
}

void loop()
{
  unsigned long time = millis();
  for (int i = 0; i < kLights; i++) {
    // Subtract the current time from the start time, then use
    // the sine to get the brightness appropriate to this point in
    // the cycle. We do only half-cycles, the positive part.
    unsigned long elapsedMillis = time - light[i].startTime;
    
    float elapsed = (elapsedMillis * 1.0) / light[i].period;
    int level = curve(elapsed) * 255;
    analogWrite(light[i].pin, level);
    
    if (elapsedMillis >= light[i].period) {
      // Once we've finished the cycle, reset: pick a new, random
      // period length, and start it up now.
      light[i].startTime = time;
      light[i].period = randomPeriod();
    }
  }
}

June 20, 2010

Whew! I finished electronics work on the second bloom light. It took just about all day, but it’s great to see it running. Remaining work: drill mounting holes and insert bolts, drill hole for power socket and glue the socket in behind, silicone-seal the diffuser onto the main mounting plate, drill holes for housing bolts and fix the sandwiches together.

Oh, yeah – I still have to write some firmware.

June 17, 2010

The Day of the Flying Fish: globalization and the making of modern sushi.” Nice short primer on the origins of my favorite meal, suggesting that sushi snobs are missing the point.

June 15, 2010

The bloom lights are coming along well, though the amount of actual construction work involved is kind of wearing me out. I’ve finished the electrical work on the first of the pair, and while I haven’t written any of the actual firmware yet, I set up a little random flicker demo which shows that the lighting effect at least basically works. It’s a little less bright than I’d hoped, but that might actually turn out to be a good thing – it’ll be displayed in low-light environments, and it’s meant to be looked at, not to illuminate its surroundings. The diffuser system works really well: it looks cool, the light has a strong sense of motion, and you can’t see any of the wires or the circuit board while the effect is running.

I recorded a little video last night, which I will try to embed here later. The actual animation will be far less spasmodic than what you see here – smooth shifts, throbbing pulses, and slow fades are more what I have in mind.

June 10, 2010

Most of my lighting projects involve low-voltage LEDs and lasers, but every now and then it’s nice to be able to control AC devices at line voltage. Here is a thorough explanation of light dimmer circuits, with schematics. Looks like the right solution for µC control might be a power MOSFET and a zero-crossing interrupt: the µC can turn power on at the zero crossing, set a timer, then turn power off any time in the next 8 milliseconds, depending on desired brightness level.

June 8, 2010

Desk at Synapse



Macbook, with VMWare, Windows on the auxiliary monitor. Power supply & test board in the corner.

June 7, 2010

Today I start my new job at Synapse, a product-development engineering firm downtown. I’ll be writing firmware for embedded controllers, teaming up with electrical and mechanical engineers to design gadgets. This is a significant change of career direction for me, and I’m looking forward to it.

Embedded programming offers a lot of the same sense of freedom I felt back in the ’80s when I was first learning to code, and programmers were in control of the entire machine. Modern software development is far more abstract – it’s more about manipulating the gargantuan stacks of libraries that do all the actual work, fitting your design into the constraints of the operating system, the network, and the rest of the software coexisting on the machine. You can do far more, of course, by building on top of all that existing code: but it lacks some of the old elemental zest.

Microcontrollers also have a lot of the same constraints that were so much fun to push through on those old computers: slow clock rates, small memory spaces, limited I/O capabilities. The ATmega328 chips I use for most of my hobby projects have a 16 MHz clock, 32K of flash memory, and 2K of RAM – and yet this is luxurious compared to, say, an MSP430. Creativity thrives on constraints, they say, and it is true that the most thoroughly satisfying few weeks on the Groovik’s Cube project last year came when I figured out just how close the color timing was going to come to the controller’s performance limit.

It’s a smallish company – looks like fifty or sixty people – and so far everyone I’ve met has been smart and enthusiastic. The office is an entire floor of a big old building – high ceilings, ornate facade, tall concrete pillars, wire runs hung from the ceiling, and a quiet hum of conversation.

I don’t know what I’m going to be working on yet, but I can’t wait to start.

June 6, 2010

We didn’t get the lanterns finished on Wednesday, so we scheduled a finish-up work party for Saturday afternoon. We set up an assembly line and sent lantern parts down one by one: first Leah, Jordan, and Maja picked out color clusters and glued them onto the lantern bases, then Becky, Ellery, and I wired up the LEDs, then Richard, Mellington, and Barry soldered them together… with some switching of positions, and some coming and going, of course. We crunched through 34 of them before I had to leave, and the rest of the crew finished off the remaining six. Forty finished multicolored LED lanterns, with (mostly) waterproof cases and ground-stakes and switches and everything! So satisfying. They are bright and will make a beautiful, unusual accent for Barry & Maja’s wedding.

After soldering, I picked up Ava and we went to see Jerboa Dance perform “continuum”. Being a modern dance piece, I wasn’t actually expecting to understand it, and was astonished to find that it had a clear story arc with individual characters who developed relationships with each other of the course of the performance. All through motion and expression. Really well done, enjoyed it, would go see it again.

June 2, 2010

The PGA2310 / PGA2311 are 8-bit stereo volume control chips. They use a three-wire serial interface, and can make volume changes on zero crossings to eliminate clicks.

LED Lantern Workshop


May 30, 2010


May 29, 2010

John M. cooks Saturday night dinner at Mul-acres


New stairs at Mul-acres



The slope between the firepit and the storage shed area was starting to look slick and muddy, so we spent a couple hours cutting steps and reinforcing them with logs.

Melanie M. being adorable


May 26, 2010

Three big boxes of parts arrived today: switches, resistors, and battery holders for the path lanterns, which we’ll build at the workshop on June 2nd; a couple of boards onto which I will build the bloom light controllers; and a pair of big plastic bowls which will serve as diffusers for the bloom lights. Not enough here to start actually building yet, but it’s fun watching it come together.

I’ve had a cold for the past couple of days. It’s mild, but I’m going camping this weekend out on John & Holly’s property in eastern Washington, and I’m not enthused about the idea of camping while ill. Oh, well, I’ll just have to rest and drink a lot of tea and hope for the best.

« Previous PageNext Page »