-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Output is nan after several hours of successful running #118
Comments
I do not have something to comment about since I haven't run into something similar. But I can confirm that I have successfully run multiple PIDs in the same program (>5), for days. I use this library since its birth. I am very interested to learn the cause of your issue. |
Just a few comments on your code:
|
In an Input was ever a nan, it will propagate through into Output and persist. You can check and protect against it in userspace before your compute step:
|
Full code is 20220308_my_working_kiln_more_logging_reduce_memory.zip but most relevant bits pasted here. I'm controlling a relay to heat a kiln, and it works perfectly for a few hours, but then after about 3 or 5 hrs Output (here variable is pidOutput) keeps being nan.
In variables section:
Setup run once:
Update loop:
updatePIDs basically just calls
pidCont.Compute();
Turn on heaters:
I've confirmed pidInput and pidSetPoint are behaving correctly.
I'm using an Arduino Uno and am using 79% of program storage and 74% of dynamic memory (at 75% it says warning low memory, may cause stability issue) - not sure if being close to this limit could be my issue.
I've reproduced this issue about 5 times now, but once it did run the full ~10hr with no nans.
Thank you very much for your thoughts!
The text was updated successfully, but these errors were encountered: