-
Notifications
You must be signed in to change notification settings - Fork 0
Open
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.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels