Skip to content

Phase Template: tank-ph-adjust

Measure pH and selectively dose acid or base in a single pass to reach a target range. Use this phase for straightforward pH trims where a single dose is expected to land within tolerance, e.g. a known buffer addition or a small in-range correction. It reads ph_sensor.PV, decides whether to dose acid (via wfi_valve) or base (via inlet_valve), runs the dose for a configured time, and verifies the final pH and conductivity.

For multi-dose correction with feedback between doses, use tank-iterative-dose instead.

Where to find it

System endpointEquipment LibraryPhases → select tank-ph-adjust.

graph TD
    Start([initial]) --> RP[read_ph]
    RP --> SC{safety_check}
    SC -->|"pH safe — pass through"| EV{evaluate}
    SC -.->|"pH extreme<br/>COMMAND&#40;'Hold'&#41;"| SC2[held for review]
    EV -->|"pH &gt; target + tol<br/>priority 0"| DA[dose_acid]
    EV -->|"pH &lt; target - tol<br/>priority 1"| DB[dose_base]
    EV -->|"pH in range<br/>priority 2"| IR[ph_in_range]
    DA -->|"wfi.FB"| AH[acid_hold]
    AH -->|"T &gt;= dose_time"| AC[acid_close]
    DB -->|"inlet.FB"| BH[base_hold]
    BH -->|"T &gt;= dose_time"| BC[base_close]
    AC --> SE[settle]
    BC --> SE
    IR --> SE
    SE -->|"T &gt;= 10s"| VE[verify]
    VE -->|"operator ack AND<br/>pH in tolerance AND<br/>conductivity OK"| CP[complete]
    CP --> Done([done])
    style SC2 fill:#ffe0b2,stroke:#e65100,stroke-width:2px,color:#000

See Phases for the diagram conventions.

What you see when it runs

Element Meaning
Active step Which branch fired — dose_acid, dose_base, or ph_in_range
Shared variables initial_ph, final_pH, and final_conductivity captured in the step actions
Prompt The phase parks on verify until the operator acknowledges the final pH reading

HMI screenshot pending

An annotated capture of a running tank-ph-adjust phase on the verify prompt will be added here.

Parameters

Parameter Type Unit Range Default Required
target_ph REAL pH 2.0-12.0 yes
ph_tolerance REAL pH 0.1-2.0 0.5 no
dose_time TIME 5s-2m yes
agitator_speed REAL % 20-100 50 no
max_conductivity REAL µS/cm 100-1500 500 no
safety_ph_limit REAL pH 1.0-5.0 3.0 no

TIME parameters take duration strings ("45s", "1m30s", "5m"), not bare numbers.

Required control modules

Role Module type Description
ph_sensor analog-sensor Tank pH measurement
conductivity_sensor analog-sensor Tank conductivity measurement
wfi_valve discrete-valve WFI/acid addition valve (on/off)
inlet_valve discrete-valve Base addition valve (on/off)
agitator analog-control Tank agitator for mixing reagents

Capability: mixing.

How it works

Each scan the SFC engine:

  1. read_ph captures initial_ph and starts the agitator.
  2. safety_check evaluates whether the initial pH is outside the safety envelope (initial_ph < safety_ph_limit or > 14 - safety_ph_limit). If so, the step self-issues COMMAND('Hold'). The phase parks in the ISA-88 Held state and an operator must investigate before Restart.
  3. evaluate diverges three ways by priority:
    • priority 0 (acid path) if pH > target_ph + ph_tolerance
    • priority 1 (base path) if pH < target_ph - ph_tolerance
    • priority 2 (in-range pass-through) if the pH is within tolerance already
  4. The active dose branch opens its valve, waits for feedback, holds for dose_time, and closes.
  5. All three branches converge on settle, a fixed 10-second hold for mixing.
  6. verify reads the final pH and conductivity and parks on a PROMPT(). The exit guard is a four-way AND: operator ack non-empty, final pH within tolerance (high and low), and conductivity within max_conductivity.

This is a PV-endpoint phase. The termination condition is a process measurement. If the sensor fails, the phase hangs. Pair with hardware-limit alarms on pH at the safe-handling boundaries and a timeoutSeconds backstop. See Phases § PV-endpoint phase.

Used in recipes

Try it

  1. HMI endpointBatch Execution+ Newsim-ph-adjust-m1Start
  2. Expand the procedural tree until the pH-adjust phase is active on mix-tank-1
  3. Watch which branch fires based on the simulated initial pH
  4. When the phase parks on verify, respond to the prompt to complete the phase
  5. Open Data endpointTrends to chart ph_sensor.PV and conductivity_sensor.PV through the dose and settle