The PID class provides a wrapper around the Arduino PID_v1 library. This issue outlines the work needed to complete functionality, improve maintainability, and ensure correct behavior across the device.
Goals
- Fully validate and refine PID functionality provided by PID_TC.
- Ensure proper handling of tunings, modes, and computation flow.
- Confirm compatibility with the Arduino PID_v1 library and target MCU constraints (e.g., 4-byte double on Mega2560).
- Review singleton implementation details for correctness and safety.
Reference: PID_TC Public Operations
computeOutput()
getKd()
getKi()
getKp()
getMode()
logToSerial()
setKd()
setKi()
setKp()
setTunings()
Singleton lifecycle:
Internal/Private Components for Review
- Constructor / destructor correctness
input, output, and set_point variable handling
- PID window size management (
WINDOW_SIZE)
- Proper initialization and ownership of the
PID* pPID instance
- Type limitations on AVR (double being 4 bytes) and impact on tuning precision
Additional Items for Refinement
- Ensure
computeOutput() correctly updates input, set_point, and output before/after PID calculation
- Validate PID mode transitions (Automatic vs. Manual)
- Evaluate logging strategy in
logToSerial()
- Confirm singleton memory handling and test behavior (
reset() vs. destructor)
The
PIDclass provides a wrapper around the Arduino PID_v1 library. This issue outlines the work needed to complete functionality, improve maintainability, and ensure correct behavior across the device.Goals
Reference: PID_TC Public Operations
Singleton lifecycle:
Internal/Private Components for Review
input,output, andset_pointvariable handlingWINDOW_SIZE)PID* pPIDinstanceAdditional Items for Refinement
computeOutput()correctly updatesinput,set_point, andoutputbefore/after PID calculationlogToSerial()reset() vs. destructor)