Non-linear PWM dimming

Discussion in 'General Electronics Chat' started by Shagas, Jul 19, 2013.

  1. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    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?
     
  2. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,173
    397
    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.
     
  3. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    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.
     
  4. BobTPH

    Active Member

    Jun 5, 2013
    783
    114
    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
     
  5. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    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
     
  6. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    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.
     
  7. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
  8. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    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.
     
  9. BobTPH

    Active Member

    Jun 5, 2013
    783
    114
    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
     
  10. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    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 .
     
  11. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    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'
     
Loading...