How avoid led flickering

Hello everyone, I'm building a flat panel for my telescope, at the moment I'm using a pwm frequency of 5kHz to get 12 bit resolution, I'm planning to go at 25kHz to avoid flickering.
For me avoid flickering is very important cause sometimes I need to shot with the camera at 1ms, and cause that frames will be used to calibrate all the "photos" is very important to avoid flickering.

Before to get higher pwm frequency I'm considering some alternatives to handle 1meter of led strip at costant current but with pwm.

Any Ideas?

PWM resolution is fixed at 8 bits, nothing you can do about that.

One ms is the equivalent to a frequency of 1KHz.
But with any multiplexed display you will never get any evenly lit display because to do that you would have to have an equal number of scans to your exposure.

Doesn't make too much sense because a constant current can't be subject to PWM. Is this an addressable strip of LEDs.

I think what you want is impossible.

Or you are not adequately describing how this calibration photograph is supposed to work.

My misspelled, I mean encrease pwm frequency, that in esp32 you can decide in function of the frequency.
Probably shutter speed can go below 1ms and here I got the problem, I will try to encrease it at 25kHz and I will see...
I would like to trim the led driver via pwm, and the led driver will do what I need, like using the LM3405A, but I never used something like this so I don't know

If you use constant current without PWM, there will be absolutely no flicker.
You just vary the current to adjust the intensity

2 Likes

Depends on hardware platform. Plenty offer >8 bit.

PWM frequency needs to be substantially more than this to prevent exposure variations. Let's say you want to limit exposure variance to 1/3 of a stop. That would mean that (very rough estimate) something like 5kHz is the bare minimum PWM frequency that could work. 25kHz should be fine.

I don't that'll give you 12 bit PWM, as it would require a clock of >102MHz. Given a 80kHz clock, the max frequency for 12 bit would be around 19.5kHz. This should still be enough for your application.

Note that very low duty cycles will result in flicker and grossly non-linear behavior. What duty cycles are you planning to use? It's no problem if you remain above 5% or so. The bottom limit depends on hardware design choices such as the MOSFET and its driver, and parasitic capacitances in the circuit.

See remarks about flicker at low duty cycles above. Note also that the max PWM frequency recommended for this particular driver is 5kHz (see datasheet, page 13). It may or may not work well at around 20kHz.
With this LED driver, you could also use linear dimming, which will avoid the flicker issue altogether. The response may not be quite as linear as with PWM dimming. You'd have to try.

But the OP says:-

We have not yet established if this LED strip is addressable or not.

Are you mixing up the PWM resolution with the A/D resolution? They are two different things you know.

I think it's pretty obvious that this is a plain 'always on' LED strip and he's about to dim this with external circuitry.
For an addressable strip of course the whole PWM story is moot since that's handled internally by the addressable LEDs.

No, I'm not mixing them up. PWM on the ESP32 platform is variable frequency and variable resolution. Resolution is up to 16bit. The product of frequency * resolution is limited by the core clock speed. Refer to ESP32 documentation and various online examples/tutorials, "you know". Psshhhh.

Hi, @forna91

What does the flat panel do?
What has PWM to do with it?

Can you please post a picture of what you are talking about.
Can you please explain to the non-astronimomical telescopian person what you are trying to accomplish?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

1 Like

Astronomy photo are much different from normal photo you got with the camera, and olso the cameras are different, you can use normal reflex but are not suitable at all (normal camera got infrared filter cut, and in the infrared you got nebulose dust signal).

A "simple" night of an astrophotographer:

You took a lot's of frame in the same object (we are talking about 1,5,10 minutes of exposure for each photo), we will call it "lights".

One time for year (if your camera got thermal control) you will do the "dark library" you set the camera temperature you use major times (-20°c for winter, 0° or -10° for summer, (professional camera got peltier cell to avoid reading noise) if your camera don't have thermal control you need to do it after light, these dark frame should be done with the same shutter speed and temperature you used to get lights, in this way you get all the noise that camera generate, in poor word you cover the scope and you continue to make lights frame (but they will be dark)

Some cameras need olso bias frame, a dark frame made at the much fast shutter speed your camera can do, and at the same temperature your lights was made.

After you collect all the lights and darks, you make "flat frames" you have to point the scope to a flat panle that is no more than a brigth square, you can use olso the sun light at the sunset or sunrise, in theory the ligth that goeas inside the telescope should be linear in all the points.
Flat frames are used to remove dust spots and vignetting from all your ligths frame.
Of course if you have a stickers on your lens or mirror this will not help you.
Flats frame have just one requirement, the histogram should be at the 50%, you can use the shutter time, gain or iso you want, and this is why I need to drim my flat panel cause the software I use can adjust the brightness by himself.

At this point some related software calibrate aech light frame removing the signal readed from bias and dark frames, and will adjust the linearity of the signal using the flat frames.
After that you get have calibrated light frames, and with some algorithms the lights frame are been stacked togheter, and you get one single frame that contain all the usefull signal you get with all the single light frames that you need to elaborate to get the resoult you want.

This is in very poor word omitting some tecnical object and parts how astrophotograpy work

After I told you how everything works, I'm trying to get the flat box flickering free, cause sometimes the shutter speed to get a perfect flat frame goes to much below and I get banding on the frames that is not the perfect things Iin these case.
Another solution is to put 2 or 3 level of withe plexiglass one the flat to reduce the brigtness and use only the shutter speed to accomplish the goal, but from the moment I spend 3 months to make the board working with the software I prefer to use a software or hardware solution :sweat_smile: and I need the PWM to drimm the brightness of the flat panel, my PWM finish to a mofset that "drim" the led strip.

I know, with 25kHz I will have 11bit resolution but I think is not a problem.

If I can make a board with the LM3405 with constant current I don't care about the speed of the pwm, olso if the maximum is 1kHz I have a way to drimm it via pwm, I can't use analog if not using an external board, but if at low duty cycle I got the same problem I need to solve it in another way how I already reply in the upper comment

The problem is how to handle a drim without pwm, I can't stay there rotating the drimmer every time I need it

You can buy constant current drivers that can be controlled by PWM or an analog voltage.

1 Like

The LM3405 takes a dimming input that's either DC or PWM. You could use a simple pot meter for this - or have an Arduino output a variable DC signal if you want microcontroller control of the dimming. The DC dimming range of a chip like the LM3405 is usually constricted to e.g. 10-100%,leaving out the bottom bit of the range for the obvious reason that the same input is used for PWM and DC dimming.

I don't know what this means, sorry. You could try and write it in your native language and then run it through Google Translate; the result may be easier to understand for me.

DC dimming has no duty cycle, so if low duty cycle flicker is a major problem for you, then the obvious route would be to try DC dimming. The drawback as pointed out above is that DC dimming with many LED drivers is constricted at the lower intensity range. They generally only work above 10% or so.

Use an Arduino to output a DC signal using either of the following options:

  • A PWM output ('analogWrite') run through an appropriate R/C filter to smooth it into a DC level
  • A DAC module connected to an Arduino
  • An Arduino (or similar) board with a native DAC output

Then feed that DC signal into any LED driver that accepts a DC dimming input.
Note that many ready-made LED driver modules want a 0-10V DC input. Bare LED driver chips usually want a DC signal that's within the range of their own low voltage supply (typically 0-5V).

Hi, @forna91
Thanks for the explanation.
So you are making a light panel to help calibrate all the shots you will take with a camera.
The problem is when using PWM control of the light panel illumination, you get strobing effects in the camera.

@jim-p suggestion in post #4 is able to eliminate that, as the current is constant DC, it value is adjusted to adjust illuminance, this is an analog method rather than a digital method as in PWM.

Constant DC control does not cause any flicker in the LED output.
The LED is constantly on, unlike the PWM method, where the LED fluctuates between the on and off states .

How much power does your light panel consume?
This will dictate the method of providing a controlled DC output for the panel.

Can you please post your circuit of your PWM control?
Can you please post an image(s) of your light panel?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

And also, what kind of panel is it in the first place?
@forna91 this question is pertinent since you mentioned a LED driver like LM3405 earlier, and I continued on that. However, many (most) ready-made LED panels and strips already have a means to control current through the LEDs, either through an onboard driver or simply through current-limiting resistors. It doesn't make much sense to combine this with a driver chip like the LM3405, which is intended to be used with 'bare' LEDs.

This is the solution you should focus on.

Well yes before we go into more detail. How big, how many leds of what type etc. In effect a LM317 can even be used to drive LEDs where the output voltage controls the current. Since you are using an ESP32, you have 2 DAC's built in already, and so you do not need to filter PWM output to begin with.

1 Like

In my case I got inside just 1 metere or 2 I don't remember, of normal led strip.

Looking to another solution one crazy guy use a small servo to rotate the led dimmer :rofl: probably is the best solution to avoid flickering

See post #13

My flat box is 50x50x50cm, on the background I got a normal led strip at 12V I don't remember exactly but I think 2 meters, all is white to check to reproduce the right linearity of the light on the top a 3mm of withe plexiglas.
Probably for a firts try, I wil add one or two additional level of whit plexiglass to see if I got a brigthness reducing avoiding to need short exposure time and get a 20kHz pwm frequency.

Don't care about it, I read the datasheet fastly and I understood that 1khz was the maximum pwm frequency :sweat_smile:

In second I will try the dc drimming whit a servo to drim the brightness :sweat_smile: