Skip to content

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

@maphineth

Description

@maphineth

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions