Getting Rid of PWM Flicker

Hi!

I'm working with LEDs as a lighting tool for video/digital cinema for a while. Most recently I got addicted to an Arri product called, SkyPanel, a RGB LED source with HSV controls for setup. And, as it's designed for video lighting, it's flicker free even on higher framerates (above 60fps) and shutter speeds.

As SkyPanels are available on 30x30cm minimum size, I felt like smaller light sources could help me lit car interior and portrait shots. On a first attempt I used the traditional RGB Strips (non addressable) with a cheap controller like this.

As I expected, getting the colors I wanted in RGB world was a pain. Besides that, any dimming down I did on the controller would make the RGB LED (strip or not) to flicker. As we have to dim R,G and B channels independently to make different colors, it became useless for video applications.

On a second take I attempted to use FastLED library to control the RGB strip using HSV parameters. As it's a 12V strip I used three IRFZ44N between the arduino and the power supply to drive the LEDs.

HSV control worked like a charm and it definitely became easier to choose colors, but the flickering issues were exactly the same as my cheap RGB controller. I kinda got demotivated and let it for a while.

Today I was asked to modify some cheap 12V dimmer based on a 555 Async for video usage. The issue was the same flickering style I had on both prior experiences.

After some bench testing, rev engineering and a couple of beers I found out that the ideal PWM frequency for video led dimming is around 6Khz. My dimmer was initially set to 60Khz. Changing a cap between pin 6 and 2 of the 555, I was able to get the frequency down and the flicker went away.

Now that I'm aware that the PWM frequency may be the issue with my Arduino controller, I'm wondering if there's a way to change the PWM down to 6Khz.

I already looked into the Secrets of PWMs and the PWM Cheat Sheet articles and understood that it's kinda limited to the prescale factors. Is it really limited to that frequencies? I believe the closest I would get to 6Khz would be 7812.5 hz on timer0 (Pins 5 and 6). I'm definitely going to try it and check the results, but I'm afraid it may not solve my flickering issues.

My questions are basically: There are any ways to get 6Khz PWMs on three pins? Also, will the PWM frequency change affect the FastLED Lib work (its advised on the articles I said that it may affect other stuff on the board).

If Arduino is not the right platform, can you guys suggest any other platforms or workarounds? I'm thinking about driving the 555s with the Arduino. Not sure how yet...

Cheers and Thanks in Advance!
Tejada

I believe the closest I would get to 6Khz would be 7812.5 hz on timer0 (Pins 5 and 6). I'm definitely going to try it and check the results, but I'm afraid it may not solve my flickering issues.

An important question is; What resolution do you require on the PWM signals. For instance the ATmega328 used on the MiniPro (likely not the best choice but the one I am most familiar with and can talk about) has 3 PWM timers, however two are only 8 bits. Meaning there are only 255 different PWM settings available.

I have used one for a complex dual channel application. For my application I used plain C for a programming language and did not use any of the "special" helpful arduino IDE extensions. This allows you to control the MCU at the most basic level to get the most flexibility available.

If you required more resolution (finer brightness steps). Off hand I can think of two options:

  • PCA9685 based (I think Sparkfun has a board based on this device)
  • Perhaps it would be easy to use 3 arduino mini-pro's using the 16 bit PWM of each. All controlled by a common clock and perhaps controlled by a encoder knob, or through an I2C serial link from a 4th board or maybe from one of the three boards.

It sounds like a misuse of computing power but once you have one working you just have to triplicate it. I have using "generic" pro mini boards from China which cost only a few dollars each. And they are pretty small.

In the above quote you said the closest you could get to 6000 Hz was 7812.5 Hz. You will have to look at the pres-callers and if you can give up some of the 16 bit resolution to get the frequency you want. Else you could change to a non standard crystal that will allow you to get closer to the 6000 Hz you desire.

Hope some of this helps, If not let me know what I can better describe.

Good luck

PS is there any video signal coming from your camera(s) that would allow you to sync the PWM frequency for minimum flickering?

LED dim modules like the meanwell LDD-xxxx can AFAIK also be used in DC (not PWM) dim mode (pot or DC voltage).
DC voltage dimming with these dimmers should produce (almost) no flicker (<5%).
Can't be used for LED strips though, but three of them can drive RGB COB lights (10-100watt?) or star base LEDs.
Not sure how hard it will be to keep the colour constant while dimming.
Leo..

JohnRob:
...PCA9685 based...

PWM frequency limit for the PCA9685 is 1kHz.
Leo..

already looked into the Secrets of PWMs and the PWM Cheat Sheet articles and understood that it's kinda limited to the prescale factors. Is it really limited to that frequencies?

Yes if you want full dimming control of 0 to 255. You can get most frequencies but when you do the range of PWM settings you can get drops. This is due to how the timers produce PWM.

However I would have thought that anything over your 6KHz frequency should work just as well.

JohnRob:
If you required more resolution (finer brightness steps). Off hand I can think of two options:

  • PCA9685 based (I think Sparkfun has a board based on this device)
  • Perhaps it would be easy to use 3 arduino mini-pro's using the 16 bit PWM of each. All controlled by a common clock and perhaps controlled by a encoder knob, or through an I2C serial link from a 4th board or maybe from one of the three boards.

I definitely would like to keep it from 0 to 255 on the three channels. The most precise I can get, the best.

JohnRob:
PS is there any video signal coming from your camera(s) that would allow you to sync the PWM frequency for minimum flickering?

Yeah, definitely there is a genlock smtpe output, synced most of the time at 23.976fps and a 1/48 shutter. In this scenario (90% of the time) I wouldn't want cables between the camera and the multiple light sources. What would be very interesting is to study how to use this genlock protocol for higher framerates than 60fps.

Wawa:
Can't be used for LED strips though, but three of them can drive RGB COB lights (10-100watt?) or star base LEDs.
Not sure how hard it will be to keep the colour constant while dimming.
Leo..

Unfortunately, in this case I need RGB Strips control (5050). Also, the whole idea is to be able to control the lights over HSV. Dimming each channel individually would give a normal RGB control, which is very hard to deal with on set.

Grumpy_Mike:
However I would have thought that anything over your 6KHz frequency should work just as well.

I will be trying to setup something again with the Arduino. I only had this test recorded which was on the standard 490hz output pins and, as expected, was flickering: Teste PWM 490hz

Once I'm home I'll try to mess with the PWM Pins 3,9,10,11 (timer 1 and 2) as they have the same base frequency: 31250Hz.

As far as I understood, the prescale factors I could use for these two timers are 1, 8, 64, 256, and 1024. In this scenario I believe the only option that may work is using a 1 prescale factor, setting both timers at 312500Hz.

TCCR1B = TCCR1B & B11111000 | B00000001;
TCCR2B = TCCR2B & B11111000 | B00000001;

The only thing I'm worried about is if the timer frequency change will end up affecting the FastLED Library... Let's see tonight!!!

Thanks once again!

if the timer frequency change will end up affecting the FastLED Library.

No it won't, it dosn't use the timers.

the PWM Pins 3,9,10,11 (timer 1 and 2) as they have the same base frequency: 31250Hz.

Not by default.