Open-Acidification / Open-Acidification/TankControllerPico

PHControl Class Implementation

Open
#17 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 PHControl class manages pH target behavior, solenoid activation, timed pH patterns (flat, ramp, sine), and optional PID-based control. This issue tracks the work needed to complete and validate pH control features across the device.

Goals

  • Review and complete all pH-control logic, including flat, ramp, and sine target modes.
  • Validate integration with PID control when usePID is enabled.
  • Ensure proper timing, switching events, and window management for solenoid and pH modulation.
  • Confirm compatibility with the hardware platform (solenoid, control pin, timing constraints).
  • Review singleton implementation for correctness and maintainability.

Reference: PHControl Public Operations

  • instance() / clearInstance()
  • getBaseTargetPh()
  • getCurrentTargetPh()
  • getPHFunctionType()
  • getAmplitude()
  • getPhRampTimeStart()
  • getPhRampTimeEnd()
  • getPeriodInSeconds()
  • getUsePID()
  • isOn()
  • setBaseTargetPh()
  • setRampDurationHours()
  • setSineAmplitude()
  • setSineAmplitudeAndHours()
  • enablePID()
  • loop()

Internal/Private Components for Review

  • Timing fields (lastSwitchMS, lastWarnMS, rampTimeStartSeconds, rampTimeEndSeconds, sineStartTime)
  • Target calculation logic: (Base target, Ramp interpolation, Sine wave modulation)
  • Solenoid control via PH_CONTROL_PIN
  • PID window management (WINDOW_SIZE) and interaction with external PID controller
  • pH function type management (FLAT, RAMP, SINE)
  • Initialization flow within the private constructor
  • Safety considerations (over-activation, timing limits, inaccurate pH oscillation, etc.)

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 by locating the PHControl class and reading its public operations, private timing fields, and initialization flow. Review the flat, ramp, and sine target logic alongside PID window management and PH_CONTROL_PIN handling. Done requires validated behavior for timing, switching, PID integration, singleton use, and hardware safety, but the issue does not identify tests or a concrete implementation boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
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.