Expose outputSum for monitoring and userspace anti-windup#65
Merged
Dlloydev merged 1 commit intoDlloydev:masterfrom Mar 22, 2023
Merged
Expose outputSum for monitoring and userspace anti-windup#65Dlloydev merged 1 commit intoDlloydev:masterfrom
Dlloydev merged 1 commit intoDlloydev:masterfrom
Conversation
Owner
|
Very nice simulation setup!
|
Author
|
Thanks. I updated the simulator at https://wokwi.com/projects/359818835102393345 The current version doesn't seem to have migrated into the Arduino Library system yet, but should soon. |
Owner
|
Oh, I only pushed the updates ... I'll create a new version shortly (QuickPID 3.1.5) and tag so Arduino can migrate it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the outputSum variable from public to private.
While the same functionality might be provided by a GetIntegral() and SetIntegral(value) or a user-space
myPID.SetMode(myPID.Control::manual);Output=value;myPID.SetMode(myPID.Control::automatic);trick, moving the variable up to Public is a minimal change.Why I think it is an important change is it helps for understanding the trickiest parts of PIDs: the behavior of the integral term. Good explanations of the functionality of PIDs often include graphs of the behavior of the components. Without access to the internal outputSum, it is impossible to see what is going on in the black box.
I've been experimenting with simulating a 1-D heat transfer problem controlled by a PID:
https://wokwi.com/projects/359818835102393345
Note that it shows the exposed integral on the LCD and the time-series, which I think is very helpful for understanding the interactions of the tuning parameters.