PWM slope
Posted: Tue Jan 10, 2012 11:21 am
Hi All-
SO I am playing with dimming on my PWM expansion module using the RAGen created PWM menu which allows you to select a PWM output for all channels.
A number of people have in the past asked about flickering on PWM outputs of around 10-20 or less. This is typically due to the LED powersupply (if your using MeanWells) dropping current to the point that the voltage required drops below the design limits and the LEDs flicker. This can be fixed by knowing BEFORE hand in your build and MAXING out the number of LED's /string such that you need to adjust the voltage pot on the controller to MAX in order to drive them at the limiting current you desire, which can be at least estimated.
For instance, I have two strings of 12 XP-E LEDs running at 900 mA which requires about 52 V at that current draw which 1 ELN-60-48P power supply can just barely manage. These dim to less than 10% PWM very nicely because I have PLENTY of room on the lower end of the voltage scale as I have MAXED out the upper end. Conversly, I also have 2 strings of 8 XP-G running at 1.4 A each which draw around 25 V but then when I dim them they drop to flicker at somewhere around 25%, in this case its bad because I screwed up and at 100% PWM I am barely above the minimum rated Voltage ouput for the controller and when it dims it drops below what the power supply can manage and the lights flicker. I am fixing this...
BUT... in PWMSLOPE (or what I assume is happening) your basically calculating a slope from the start and end PWM settings over the desired time and then just ramping at a calculated increment every X time.
Since NO PWM string can really run to ZERO, and everyones build will have a different cut off PWM dim for flicker (dependent upon factors I discussed and others) it makes more sense to use a function that takes into acount the Y intercept at the partical Zero setting for PWM dimming.
I.E. If you simply allow users to input the lowest PWM setting that enables reliable light without flickering and then calculate the actual PWM output required by rearranging the equation for a line using the intercept value, people could choose PWM output settings that span 0-100 of their usable range and the function would (with knowledge of the intercept) automatically set each PWM string output to the USEABLE range. This is really VERY SIMPLE but does require that users figure out the lower limit of their PWM dim range for each string (which they must know anyway if they are asking about it).
Its really kinda semantics as the user is modifying every PWMSLOPE function to set the lower limits anyways but by using a line with an intercept then if you wanted to run the cloud function you would NEVER see it flicker because the ZERO set point would always be the lowest real light output setting on the driver, and never drop below that point. It also would save some thinking as you could just set each one to the exact percent brightness value that is available. Nothing would change in terms of the useable PWM output. It may reduce somewhat the confusion some have with this as well as enabling a single line of code to define the intercept value (the real PWM% value required to sustain minimal light output without flickering) and from then on every brightness setting in ANY part of the code would be 0-100% which makes more sense.
SO I am playing with dimming on my PWM expansion module using the RAGen created PWM menu which allows you to select a PWM output for all channels.
A number of people have in the past asked about flickering on PWM outputs of around 10-20 or less. This is typically due to the LED powersupply (if your using MeanWells) dropping current to the point that the voltage required drops below the design limits and the LEDs flicker. This can be fixed by knowing BEFORE hand in your build and MAXING out the number of LED's /string such that you need to adjust the voltage pot on the controller to MAX in order to drive them at the limiting current you desire, which can be at least estimated.
For instance, I have two strings of 12 XP-E LEDs running at 900 mA which requires about 52 V at that current draw which 1 ELN-60-48P power supply can just barely manage. These dim to less than 10% PWM very nicely because I have PLENTY of room on the lower end of the voltage scale as I have MAXED out the upper end. Conversly, I also have 2 strings of 8 XP-G running at 1.4 A each which draw around 25 V but then when I dim them they drop to flicker at somewhere around 25%, in this case its bad because I screwed up and at 100% PWM I am barely above the minimum rated Voltage ouput for the controller and when it dims it drops below what the power supply can manage and the lights flicker. I am fixing this...
BUT... in PWMSLOPE (or what I assume is happening) your basically calculating a slope from the start and end PWM settings over the desired time and then just ramping at a calculated increment every X time.
Since NO PWM string can really run to ZERO, and everyones build will have a different cut off PWM dim for flicker (dependent upon factors I discussed and others) it makes more sense to use a function that takes into acount the Y intercept at the partical Zero setting for PWM dimming.
I.E. If you simply allow users to input the lowest PWM setting that enables reliable light without flickering and then calculate the actual PWM output required by rearranging the equation for a line using the intercept value, people could choose PWM output settings that span 0-100 of their usable range and the function would (with knowledge of the intercept) automatically set each PWM string output to the USEABLE range. This is really VERY SIMPLE but does require that users figure out the lower limit of their PWM dim range for each string (which they must know anyway if they are asking about it).
Its really kinda semantics as the user is modifying every PWMSLOPE function to set the lower limits anyways but by using a line with an intercept then if you wanted to run the cloud function you would NEVER see it flicker because the ZERO set point would always be the lowest real light output setting on the driver, and never drop below that point. It also would save some thinking as you could just set each one to the exact percent brightness value that is available. Nothing would change in terms of the useable PWM output. It may reduce somewhat the confusion some have with this as well as enabling a single line of code to define the intercept value (the real PWM% value required to sustain minimal light output without flickering) and from then on every brightness setting in ANY part of the code would be 0-100% which makes more sense.