Skip to content
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

PWM auto-phasing for lights by default (new behavior) unless SetOption134 1 #14590

Merged
merged 3 commits into from
Jan 25, 2022

Conversation

s-hadinger
Copy link
Collaborator

Description:

ESP32 only (including ESP32C3/S2)

You can revert to previous behavior (synced PWM) with SetOption134 1

Change in behavior for PWM. Until now all PWM phases were synced and started at the same time. This could cause increased stress on the power supply because the instantaneous power is high, even if average is low. This was also blocking from using H-bridge.

IMG_2062

Now the default behavior is that each PWM pulse starts at the end of the previous pulse (yellow is PWM1, blue is PWM2). This also makes H-bridge possible as long as PWM1+PWM2 do not exceed 100% (possibly use LedTable 0 to disable gamma correction)

IMG_2061

This feature also works for PWM inverted PWMi, the phase is based on the active part of the pulse (high for PWM, low for PWMi).

This feature has currently no impact on PWM (when SetOption15 0).

This PR also includes minor refactoring of PWM ESP32 functions to remove inlines.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.2.1
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst
Copy link
Owner

arendst commented Jan 25, 2022

Nice pictures!!

Thx.

@arendst arendst merged commit 7adbb99 into arendst:development Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants