Non-linear PWM dimming

Thread Starter

Shagas

Joined May 13, 2013
804
Hello

So I tried dimming LED's with PWM yesterday using my AVRmega48.
I used I/o for the PWM , and I think the that the code is irrelevant
for the following issue so i'm not going to post it .

***
The issue is that when the duty cycle approaches very small percentages (<7%) then there is a huge drop in the LED brightness and vice versa: When increasing the duty cycle from 0% upwards it turns on alot after a few percent and then progresses relatively linearly . Why is that?
I understand that our perception of brightness is non-linear , but that has nothing to do with this .
My best guess is that this has something to do with semiconductor sorcery due to the fact that at low percentage duty cycles the pulses are very short .

***

I have the LED's connected through a BJT general purpose NPN (22kohm at base) and the PWM is running at 10khz . Thing is the same issue happens without the transistor so I think the problem isn't there either .

I am using Blue smd led's with about 10ma current .

Anyone care to shed some light on this?
 

Bernard

Joined Aug 7, 2008
5,784
What does an O-scope show with decreasing duty cycle; no scope, try a low pass filter on output, something like 1k & 100 μF, & measure with VOM.
 

Thread Starter

Shagas

Joined May 13, 2013
804
Thanks for the answer , my crappy handheld Oscilloscope shows duty cycle decreasing as it's supposed to .
Hmm I'll try the lowpass. I'm guessing that it's going to smooth out the curve.
 

BobTPH

Joined Jun 5, 2013
9,003
I think it is the normal perceptual effect. When I have used PWM dimming, I can hardly tell the difference between 50% and 100%, whereas at the lower end, the steps can be large. To get uniform dimming, you have to use steps based on a log scale.

Bob
 

Thread Starter

Shagas

Joined May 13, 2013
804
well thing is that from 10-100% it's almost 'perceptively' linear or at least slightly curved .
But there is a huge cliff at 2-5% (don't know the exact percentages) so I thought that it is a semiconductor thing..
But maybe a log scale would fix the issue , don't know . I don't have the necessary skills yet to implement a log function into MCU PWM
 

mcgyvr

Joined Oct 15, 2009
5,394
Look at the datasheet for the LED..
Check the luminous intensity vs forward current graph..
Many of the "high power" led datasheets I've seen don't plot the curve all the way down to 0ma.. I'd suspect you've found out why.
 

wayneh

Joined Sep 9, 2010
17,498
Current vs Luminous intensity is almost linear .
Still, why would we even consider current anyway?
The "almost" answers your own question. If you want peak efficiency in the high intensity range, you gain from cutting current first and then duty cycle as the average intensity falls still further. So you might use PWM to reach 90% intensity at 100% duty cycle and then push the final 10% by raising the peak current. I believe high-end controllers exploit this effect. A downside is that color shifts slightly with current and this can be an issue in critical applications.
 

BobTPH

Joined Jun 5, 2013
9,003
What PWM frequency are you using? If it is very high, maybe you are losing a lot of time in switching at lower duty cycle.

Bob
 

Thread Starter

Shagas

Joined May 13, 2013
804
The "almost" answers your own question. If you want peak efficiency in the high intensity range, you gain from cutting current first and then duty cycle as the average intensity falls still further. So you might use PWM to reach 90% intensity at 100% duty cycle and then push the final 10% by raising the peak current. I believe high-end controllers exploit this effect. A downside is that color shifts slightly with current and this can be an issue in critical applications.
Even though that Didn't answer my question(the problem is inthe lower end of the duty cycle percentages) , It was helpfull info for the future, thanks .
 

Thread Starter

Shagas

Joined May 13, 2013
804
What PWM frequency are you using? If it is very high, maybe you are losing a lot of time in switching at lower duty cycle.

Bob
The PWM is at 10khz . So at 10% duty cycle the pulse is 10uS Long. Can the Led do that?

also what do you mean by 'losing time in switching at lower duty cycle'
 
Top