You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have an input that updates much more often than the slow PWM period, and the input is a bit noisy, the output can toggle several times each period in response to input changes.
In my case, I had a PID input that was updating every 5s and a PWM period of 5 minutes. When the system was in steady state, I would frequently get the output switching a few times on each PWM cycle due to noise on the temperature sensor. I do already have some smoothing on the PID output, but it seems that this isn't sufficient.
Obviously this should be easy to address with a filter on the sensor, and on reflection, I think the current behaviour is potentially useful, as it allows the system to respond quickly to big changes (such as turning the heating on and off), but it wasn't obvious to me from the documentation.
In fact, the documentation for the sigma delta output seems to suggest that it won't do this:
Unlike with Slow PWM Output, it is possible to update the output value with each update cycle, not just at the end of a longer period.
Perhaps the documentation for Slow PWM could be expanded with an additional note saying something like:
Note
The duty cycle will be recalculated whenever the input changes, and the output will be updated to reflect that. This can lead to the output toggling more than once per period particularly if the input is noisy, and has an update interval much shorter than the PWM period. It may be necessary to reduce the input period, or use filters to rate limit and/or smooth the input on order to avoid unwanted toggling of the output.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The problem
Slow PWM recalculates its duty cycle every loop. This means that if the input changes mid-cycle, the output can change.
If you have an input that updates much more often than the slow PWM period, and the input is a bit noisy, the output can toggle several times each period in response to input changes.
In my case, I had a PID input that was updating every 5s and a PWM period of 5 minutes. When the system was in steady state, I would frequently get the output switching a few times on each PWM cycle due to noise on the temperature sensor. I do already have some smoothing on the PID output, but it seems that this isn't sufficient.
Obviously this should be easy to address with a filter on the sensor, and on reflection, I think the current behaviour is potentially useful, as it allows the system to respond quickly to big changes (such as turning the heating on and off), but it wasn't obvious to me from the documentation.
In fact, the documentation for the sigma delta output seems to suggest that it won't do this:
Perhaps the documentation for Slow PWM could be expanded with an additional note saying something like:
Which version of ESPHome has the issue?
2024.6.3
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.11.6
What platform are you using?
ESP32
Board
No response
Component causing the issue
No response
YAML Config
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: