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

Adding Public Methods for Error Sum Access and Reset #934

Open
robberwick opened this issue Apr 21, 2024 · 0 comments · May be fixed by #935
Open

Adding Public Methods for Error Sum Access and Reset #934

robberwick opened this issue Apr 21, 2024 · 0 comments · May be fixed by #935

Comments

@robberwick
Copy link
Contributor

Currently, the PID class provided in the header file lacks public methods to access the current value of error_sum and to reset it to zero. These functionalities are essential for users who want to monitor the error sum or reset it as needed during runtime. For example, the getter would enable users of the library to know when a wheel has locked up or power has been lost, and the reset method would provide the ability to remediate that error state.

Proposed Solution:
To address this limitation, I propose adding two public methods to the PID class:

  1. float getErrorSum() const;: This method will allow users to retrieve the current value of error_sum without modifying it.
  2. void resetErrorSum();: This method will reset the value of error_sum to zero, enabling users to clear accumulated error terms when necessary.

Expected Benefits:

  • Enhanced usability: Users will have convenient access to monitor and manage the error sum within the PID controller.
  • Improved flexibility: The addition of these methods will make the PID class more versatile and adaptable to different control scenarios.

Impact Assessment:
This enhancement should have minimal impact on existing codebases as it only adds two simple public methods to the PID class. However, it greatly enhances the usability and flexibility of the class.

Additional Notes:
Consideration should be given to documenting these new methods appropriately in the class documentation to ensure users understand their purpose and usage.

Thank you for considering this improvement to the PID class. Please let me know if further clarification or details are needed.

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 a pull request may close this issue.

1 participant