Thursday, July 8, 2010

If I had an oscilloscope, this is what it would look like.

Sadly, though, I don't have one. So I spent the day figuring out in theory why my lights are flickering. But I think I've found the problem, through roundabout and purely theoretical equations. Right now I really wish I hadn't slept through 3 years of high school math...

Briefly, this shows 1/48 of a second, the exposure time (Tv, if you're a Canon person) for a movie camera shooting at 24 frames per second (triangle wave). The effective exposure time is when the shutter is at least 50% open, exposing light to the film/sensor (thanks M&P!).

The tall sine wave is 120vac power at 60Hz, with peaks at 120Hz. I drew all the peaks as positive, as we're only concerned with "on" and "off" here, not polarity. This is the "flicker rate" of an incandescent bulb, but they don't really flicker due to a sort of "heat momentum" that carries the light through to the next peak. LEDs, being much more efficient, however, do not have this momentum, so they are much more prone to flicker.

The very short arches are the 12vdc rectified power, with positive peaks also at 120Hz. But the taller 120v peaks are easier to see, so we'll use those for reference. The vertical axis is not necessarily to scale, as we're comparing a lot of different things here.

The gray bars represent the PWM dimmer signal, at 1kHz. The width of the bars shown is at 100% duty cycle; as the light is dimmed down, the bars would get narrower. This is the amount of time that the power is "on" to the LEDs. The positive bars are "on time" and the negative bars are "off time."

Now, for why I've spent so much time doing this: The problem is that the LEDs are flickering visibly toward the low end of the PWM dimmer (picture much narrower gray bars). This is no good for camera. I had thought the problem lied with the PWM frequency, or the fact that I broke the legs off the rectifier's smoothing capacitor.

But it appears now to be the latter. If you look, there are 2 dips of the 120Hz power within the exposure time. Even though the PWM may be up full (100% duty cycle), if the input power is rising or falling, it is not putting out 100% brightness. If we assume, like the effective shutter speed, that the LED is only effective at 50% output or greater, the gaps widen significantly, and the flicker becomes even more apparent.

The Arduino PWM can allegedly go up to 64kHz, which is great, but without a clean DC power source, it wouldn't make a difference. Too bad I exploded the replacement capacitor today... apparently there is good reason behind the adage "don't plug it in while the power is on..."

No comments:

Post a Comment