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

Modify the code (PID_v1.h) with these improvements for better efficiency #148

Open
Maphineth-UNG opened this issue Nov 13, 2024 · 0 comments

Comments

@Maphineth-UNG
Copy link

The file defines a PID class for a control system, including several functions and variables that handle PID calculations, configurations, and mode settings. It includes:
- Constants for configuration.
- Public methods for setting modes, computing PID outputs, setting output limits, tuning parameters, etc.
- Private member variables for storing PID parameters and tracking the state.

I have modified the file to enhance its efficiency by:
- Replacing #define macros with constexpr for better type safety.
- Using initializer lists in constructors for improved performance.
- Making getter methods inline to optimize frequently accessed functions.
PID

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