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

Altered RelayOutput example behavior #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesprior
Copy link

I recently made a mechanical relay based PID with time proportioning control but I noticed some behavior in the sample that was unexpected, and this pull request is an attempt to address those.

First, is that given a window size of 5000 and a PID output of say, 2000 I would expect the PID to be on for 2000 out of 5000 milliseconds. The call to myPID.Compute(); inside the main loop changed the output each loop so out of a 5000 millisecond slice of time, the output could vary between 2000 and 0. I am not an expert in PIDs but it seems like it would make it hard to maintain a consistent temperature when the response depended on more than just the output state.

The other change I made was to put in a floor so that the relay would be on for a minimum amount of time. My assumption is that mechanical relays have a response time, and anything below the response time is not useful.

Finally, thank you for writing the PID library and contributing, I find it very useful and I'm glad you made it.

drf5n pushed a commit to drf5n/Arduino-PID-Library that referenced this pull request Mar 21, 2023
- Resolved `Kp` windup  as noted in issue br3ttb#6. Algorithm reverts to upstream library, but with fixed point math option and newer controller direction method maintained.
- Updated AutoTune examples and documentation.
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