Open-Acidification / Open-Acidification/TankControllerPico

PID Class Implementation

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2
Forks
1
Avg merge
2h 22m
Merged PRs (30d)
2

Description

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:

instance()
reset()

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PID_TC public operations and its PID_v1 integration, then trace computeOutput(), tuning and mode methods, and the instance()/reset() lifecycle. Review the constructor, destructor, PID* ownership, window sizing, and AVR numeric constraints. Done means the listed operations and singleton lifecycle are validated across the stated modes, calculations, memory behavior, and target MCU constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.