-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Change PWM frequency per channel/pin #2642
Comments
It would but you would need to modify source to your needs. |
Thinking of it if these are analog LEDs they really don't care about PWM frequency. |
Thanks for your feedback! I guess I'll try first just like this and if not then look into the function. |
I believe with LEDC on the ESP32 lower PWM frequency results in a higher gray-scale bit-depth. 20kHz only has 4096 steps, Whereas 2.4kHz has 32768 steps. At least for ESPHome, this higher bit-depth results in much smoother dimming transitions. Reference: https://esphome.io/components/output/ledc.html#recommended-frequencies |
There is some ongoing discussion about using higher PWM frequency and improved PWM resolution: #2868. |
FX_2Dfcn.cpp.setUpMatrix: - move upstream code to reset==true - temp table for ledmaps (Idea by By @troyAircoookie#2642) FX_2Dfcn.cpp: init loadedLedmap
Hi, |
You can compile your own version with modified/changed frequency. There is no need to modify source files for that. |
Thank you for pointing that out. Considering that PWM is generated by software I like to ask the following:
Again, if there is a good reason for something I will definitely accept that. But if things can be improved with relatively low effort without noticeable disadvantages, why not adapting them? Cheers |
In fact, there is a reason - if you are using 8266. The chip cannot run 8bit PWM at higher frequencies than ~900hz. Edit: The LED strip usually does not create any sound - PWM is a pure electrical thing. But some Power Supply Units will not work well with PWM - these may beep, its called "coil whining". Sometimes it helps to choose a higher quality PSU. |
Okay, thats interesting. From other projects like tasmota or esphome I know that one can set somehow higher frequencies for soft-PWM. But anyway, maybe they they just deal with the fact that resolution gets down as a compromise. For one of my tasmota lights I set the frequency DOWN to 200 Hz which still causes some flicker if I move my eyes really fast, but now it does not peep anymore...
That is only partially true. Of course coil ringing occurs in many application, no doubt about that. Because also in these applications the coil is pulsed by some kind of signal - in many cases a PWM.
If we can't get higher in frequency because of loss of resolution or anything else: what about the option to go DOWN? Of course you might have to deal with flicker effects at some point. We all know this. But why not leaving this up to the user by providing this option? Then one can choose whatever fits best to the users requirements. |
@Jojo-A I'm not interested to prove you wrong, especially I'm not going to argue about what you hear. btw, below is the source code responsible for setting PWM frequency. If you have a clever idea on how make PWM faster, please feel free to create a PR Lines 433 to 440 in 51b3d7c
Lines 390 to 394 in 51b3d7c
Lines 291 to 323 in 51b3d7c
|
Okay perfect, thank you! About PR: I will try to compare the way how PWM is generated in different projects. Lets see what I can find. |
👍 To get you started with using the development env (i.e. VSCode+platformIO) look into our KB |
Okay, I've set up a minimal platformio core environment for compiling WLED sources. Thank you! By the way: the really annoying peep sound has disappeared now. The flickering is fast enough that it is only noticeable when I move my eyes really fast. |
Setting custom PWM frequency is already implemented in WLED but it lacks UI (only available for 2 pin digital LEDs). |
Okay, that was much too easy XD ! Sorry for the irritation caused! |
We do have PayPal links if you feel generous. 😉 |
Changing PWM frequency is now possible in 0.15.0 beta 1 or later. |
Hi,
I'm trying to mod an Aukey desk lamp using an ESP8266 board and WLED. I've found a teardown of my exact lamp, and someone has been kind enough to document what type of signals the onboard IC that I would have to replace is putting out:
Since I want to control all four channels, I need a way to set the PWM frequency differently for the white channel than for the color channels. Would this be possible? Thanks!
The text was updated successfully, but these errors were encountered: