Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Multi independent PWM

Status
Not open for further replies.
X

Xenon02

Guest
Newbie level 1
Hello !

I have 24 high power LED drivers and each one of them requires independent PWM, is there any IC that has couple of independent PWM channels and I can program it using any interface ?
 

Posts 4# and #7 show you the 1 chip approach for PWM, I built that project
and it routed fine. The only thing I did not investigate was using its DMA to do
a in background process of updating PWMs automatically, and you just update
a buffer of PWM values when needed. Not sure anything could be gained. Note
in post #7 I added to it (also internal/onchip) use of SAR to measure current of
each LED (you put a current sense R in each LED leg) and modify the value you
write to PWM to get better brightness matching. Your could even add a T sensor
to display board and use that as an input to modify values to be written to each
PWM or use as LED protection......

As shown in post #35/#37 this can be done alternatively, still one chip, using density
modulators versus PWM modulators. Using density modulators -

1711710431489.png


If you want I will post the PWM project and you can download the IDE (PSOC Creator) and
look it over, your call. The PrlSM project I did not copy/paste all 24, but could be easily done.


Regards, Dana.

PS : Actually the DMA process could incorporate the "need to update/write PWM" case.
eg. only write when change needed. To eliminate high write activity causing artifacts discussed
in earlier post.... Also eliminates waste of MIPS doing un-necessary writes.....
 
Last edited:

u only need 24 x 1 but a FET switch for each Ch. for "high" current

View attachment 189596
You have now 30 1A LEDs not 24 and that means you want to use 30 complex drivers when all you need is a FET current limited by a power resistor that drops a fixed 1A*R = 0.3 to 0.5V. This reduces the variation in Vf per LED with the added V=IR so you regulate all LEDs at 1A at 100% PWM. This is the same method used in class AB audio power amps due to mismatched rBE’s. Then you need to create a series register with all 30 PWM 12 bit values plus some other bits as often as you want to make changes.

So you can replace your CC driver and use the 20 mA of the above solution to PWM the FET to draw 1A from your regulated constant voltage around 6.5V

If you have been given poor quality LEDs with a wide variation in the 6V @1A like 10% then can choose better ones from Samsung or Cree.
 

@Xenon02, correction to schematic in my pin numbering.

The 30 sensors are 30 R's. 1 R per LED to check/cal its LED current, if OP decides to use
that approach.


1711725052682.png


To do the 30 development you need a board with enough I/O, which is more costly,


Or you could user the cheaper board, and place on a separate page the excess resources,
and disable that page while doing the dev.

Or use the cheaper board, snap off the debug/programmer portion, and wire that up to
a target chip......food for thought.


Regards, Dana.
 
Last edited:
I still don't understand what you use in it, like ADC SAR etc.
Is it possible to change duty cycle in it ? And I need to have a board ? PWM was supposed to be just a part of the PCB lamp or so I imagined.
Well nevertheless I will stop here tbh, thanks for the help I will stop here and do my own thing. Although I feel defeated of my own incompetence plus the miscommunication, but mainly the incompetence, and I was expecting something else.
Thanks for the suggestions, I will look something in FPGA and in LT I saw earlier, because there aren't many PWM generators IC which is a bit shocking because I thought there are.
 

The SAR was to help in brightness matching by measuring a R (low ohm shunt) in series with each
LED. LED brightness a strong f() of its current. So if you found one or more that was using less
current than say others, you could raise its PWM duty cycle to offset the fact it develops less
brightness at same current as some others you use as a reference. And the inverse is true, if
its too bright you would correct the PWM value for that. Basically do a cal cycle when system
starts, all PWMs set to same value, and measure each ones current. Save that in a correction
array, and use those offsets when changing a specific PWMs value. So Lamp is not irregular
in its optical appearance.

But if you buy matched LEDs than no need to use it. Simple as that. Dont use the SAR.

For the 30 PWMs I show in last project poist, yes every PWM can have its own settings, realtime.
There is a simple f() call associated with it to do that. Keep in mind those PWMs are all on 1 chip.
Along with the processor and a bunch of other stuff. Processor would use code to control
each PWM and its settings. Code to do that simple, register writes.

The boards I am recommending are for development, ultimately you would lay out a board
with just chip and its supply and that would be core of finished design.

Think of PSOC as a pile of standard functions, like counter, PWM, display....+ memory +
CPU + FPGA like fabric + analog. Its like having a giant breadboard with a bunch of parts
but all in one part....Use what you like, not what you dont need (but its still in part).

Lastly you need a n interface to control the PWMs, like serial or parallel or whatever,
thats why i showed USBUART, because of its simplicity and ease of writing a GUI on a
PC to talk to it, control it. Or use I2C, SPI, CAN.........many serial capabilities are also onchip.



Regards, Dana.
 
Last edited:
I don't understand the first paragraph sorry. How the calibration works etc, I need to see a video with example because with words I don't get it.
But okey I do have in mind this is 1 chip, and it's good to know I can change the duty cycle in it.

Thanks for the recommendation.
 

How a calibration might work.

1) You set all PWMs to 100% duty cycle, full on.
2) You read each current sense R thats in series with each LED, you know
R, you measure its V, then you have I. That value goes into an array, one entry
for each LED, the basis of its brightness. But two columns as we will compute
a correction factor to store in it for each LED.
3) You now search array for highest value, brightest LED.
4) Now you find the factor of all other LEDs that would cause them to be at same
current level, that of the brightest. So if brightest was 100 mA for example, and you
had another LED at 85 mA, then you need to boost the duty cycle value such that it
causes LED operate at 100 mA. So in this case :

Iledcorrected = Ileduncorrected X Corrfactor or Corrfactor = Iledcorrected / Ileduncorrected
So Corrfactor = 100 mA / 85 mA = ~ 1.177 And we store that value in the array for that LED.

So anytime we want to change a LED to a given brightness we multiply the value for the
target brightness by the correction factor.

Quite simple coding. Note you can run cal routine at turn on, or periodic if environmental
conditions change, like T.

There are other error fitting approaches one uses if object non linear, but for now skip
for brevity. Note more sophisticated systems use non linear curve fitting due to fact eye
is non linear. Using power series algebraic type solutions for example. This is a topic of
broad interest and discussion both in academic circles and actual product design.


Regards, Dana.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top