LED Driver flash application using PWM

Thread Starter

kowshik1729

Joined May 10, 2020
99
Hi guys,
I'm designing a PCB that has 8x AL8862 LED drivers that drive different type of LED's like R,G,B,IR,UV etc and each string needs a different current hence so many drivers. My application requires a particular feature to be implemented where all these LED's should be flashed for a very short duration which is configurable let's say 200mS / 400mS etc., Which means, I need to control the PWM of each driver separately for which I'm planning to use an ESP32, however I am completely confused how do I control the pulse time.

I need to send a PWM wave to control the brightness and at the same time this PWM shouldn't be on for more than 200mS, my doubt was is it okay if we send multiple PWM pulses with respective duty cycles within this 200mS to the drivers? Or do we need to exactly send 1 PWM pulse configured at 5Hz frequency (200mS time period) so the drivers will switch on for the exact pulse time and operate at the exact duty cycle provided.

Please let me know if I confused anyone :) I'm happy to elaborate more. Also, here's a small picture for better explanation

1736458466157.jpeg
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
Are all the LED strings to be flashed at the same time?
Yes sir that's right. A sub milli or micro second delay is fine to have. I am planning to have a timer interrupt inside which I'll toggle all pwm's sequentially and switchoff but not sure if there'll be huge delay. Any suggestions around this is also appreciated
 

LowQCab

Joined Nov 6, 2012
5,101
Let me see if I can translate ..........

I'm guessing that,
You want to set a Color-Balance by using a different, adjustable, PWM% to each LED-Driver,
so that the combined Output of all LEDs equates to a particular "Color-Pallet",
but at the same time,
You want to be able to set an overall "Light-Intensity" by
varying the PWM% to all drivers equally, and at the same time,
but without changing the previously set "Color-Balance".
And then, be able to "Flash" on all LED-Drivers for a preset time-period, with an external Trigger.

Does this sound correct ???
.
.
.
 

sghioto

Joined Dec 31, 2017
8,633
Yes sir that's right. A sub milli or micro second delay is fine to have. I am planning to have a timer interrupt inside which I'll toggle all pwm's sequentially and switchoff but not sure if there'll be huge delay. Any suggestions around this is also appreciated
The delay shouldn't be any longer then the time to read the code I would suspect.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
but without changing the previously set "Color-Balance".
You have got 90% of it correct, the above quoted message need not happen. Once I create a color pallet this exact color that is produced should be flashed for 200mS. To keep it simple, if I use R G B leds, if I set 40, 25,67 as duty cycles for each LED's we will end up at a particular color right. Now this color should blink for 200mS.
 

sghioto

Joined Dec 31, 2017
8,633
I am completely confused how do I control the pulse time.
After the 8 pwm generators have been sequentially activated couldn't a 200ms pause be implemented followed by
deactivating all pwms generators sequentially or simultaneously?
There is a hardware solution available as well.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
After the 8 pwm generators have been sequentially activated couldn't a 200ms pause be implemented followed by
deactivating all pwms generators sequentially or simultaneously?
Hi yes this can be done, but my doubt is what should the frequency that my PWM's has to be configured to? AL8862 driver says PWM should be anywhere between 100Hz to 1Khz, if I give a 100Hz signal then period of each pulse will be 10mS, and if I apply this signal for a duration of 200mS then 20 pulses will be given to the driver at a constant duty cycle. Will this cause any issue with the pulse effect I am trying to achieve? is it okay if we give multiple pulses?

Sorry if these sounds like noob questions, I really need to get this clarified, else I need to implement hardware changes like adding a fast switching mosfet at the input of the drivers and switch that simultaneously providing the PWM (which I think is unnecessary if my PWM works)
 

LowQCab

Joined Nov 6, 2012
5,101
There is no advantage to going below ~500Hz,
and no advantage to going over ~1kHz,
as long as You are somewhere in the middle, everything will be just fine.

Lower Frequencies may start to introduce flickering,
Higher Frequencies may start to have issues with wiring practices not designed for higher Frequencies.
With a dedicated, Shielded, Twisted-Pair-Cable carrying the PWM-Signal
the highest Frequency could easily be ~10kHz, but it would be of little or no advantage.
.
.
.
 

MisterBill2

Joined Jan 23, 2018
27,217
Really, what seems like the simplest scheme, is to gate the PWM signals with logic AND gates. Each of the 8 , or however many you want, can be gated "ON" for adjustment, , and then for that "flash"all gated on and off in unison. Cheap and easy plus simple to understand.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
Really, what seems like the simplest scheme, is to gate the PWM signals with logic AND gates. Each of the 8 , or however many you want, can be gated "ON" for adjustment, , and then for that "flash"all gated on and off in unison. Cheap and easy plus simple to understand.
How is the flash timing managed with just logic gates?
 

MisterBill2

Joined Jan 23, 2018
27,217
The gates are not for timing, just for control and selection.
The duration of the actual flash can be determined with a string of decade counters fed by a crystal controlled oscillator. If the time base frequency is 1000 Hz, then four decades will allow setting flashes up to ten seconds, with one millisecond resolution.
The simple scheme would use DIP switches to select the ones, tens, hundreds,and thousands of milliseconds of flash duration.
The use of Dip switches avoids all of the unknown processor delay times in a software controlled system. If no flash time over a second will be needed, the fourth decade could be eliminated.
 

MaxHeadRoom

Joined Jul 18, 2013
30,565
I recently completed a similar project for a poster that required phasing in LED strings using PWM, but every few seconds, for the rate you want, 200ms? you may not notice the change time, I used a PIC with PPS (Peripheral Pin Select) to switch between each PWM controlled output,
At 200ms you should not see much of the switching result if using the same method.
.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
I recently completed a similar project for a poster that required phasing in LED strings using PWM, but every few seconds, for the rate you want, 200ms? you may not notice the change time, I used a PIC with PPS (Peripheral Pin Select) to switch between each PWM controlled output,
At 200ms you should not see much of the switching result if using the same method.
.
Hi, can you provide more details please? If possible the pic code in case it's nom confidential?
 
Top