Open-Acidification / Open-Acidification/TankControllerPico
PHControl Class Implementation
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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