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

ZeroDivisionError with self._induced_amplitude=0 #6

Open
FilipDem opened this issue Sep 28, 2024 · 0 comments
Open

ZeroDivisionError with self._induced_amplitude=0 #6

FilipDem opened this issue Sep 28, 2024 · 0 comments

Comments

@FilipDem
Copy link

I integrated the autotuning algorithm in my virtual thermostat for electric house heating.
It seems to work fine, however from time to time, I got a "ZeroDivisionError" in line

pid-autotune/autotune.py

Lines 200 to 201 in 60505e9

amplitude_dev = ((0.5 * (abs_max - abs_min) - self._induced_amplitude)
/ self._induced_amplitude)
.

This means that self._induced_amplitude is zero. How to deal with this? Simply skip the run by adding a test in

if inflection and (self._peak_count > 4):
?

Thanks for comment!

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

No branches or pull requests

1 participant