Basic
20 min

Chemical Dosing Control

dosingwaterproportionalalarmREAL
Chemical Dosing Control scenario preview

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in

Briefing

A chemical dosing system injects reagent into a water main proportionally. When flow is active and the operator enables dosing, the dose pump runs at a speed inversely proportional to the chemical tank level (smaller tank = more concentrated injection needed = faster pump speed). The dosing skid's VFD takes its speed reference directly from a proportional controller block in your program: declare DOSE_PID : PID and run it P-only so its CV equals (100 − TANK_LEVEL). A LOW_TANK_ALARM input cuts off dosing immediately and activates the LOW_TANK_LAMP warning.

Objectives

  • DOSE_PUMP_RUN energises only when FLOW_RUNNING AND DOSE_START AND NOT LOW_TANK_ALARM
  • Dose speed (DOSE_PID.CV, 0–100%) is proportional to (100 – TANK_LEVEL): emptier tank runs faster
  • LOW_TANK_ALARM stops the dose pump and lights LOW_TANK_LAMP
  • LOW_TANK_LAMP stays ON while LOW_TANK_ALARM is asserted
  • When dosing is disabled or flow stops, DOSE_PUMP_RUN drops and the dose speed parks at 0

Hints

  • DOSE_PUMP_RUN := FLOW_RUNNING AND DOSE_START AND NOT LOW_TANK_ALARM
  • Declare the controller instance exactly as DOSE_PID : PID; — the skid VFD (and the grader) read DOSE_PID.CV
  • P-only proportional maths: DOSE_PID(SP := 100.0, PV := TANK_LEVEL, Kp := 1.0, Ki := 0.0, Kd := 0.0, MIN := 0.0, MAX := 100.0, DT_MS := 50, ENABLE := DOSE_PUMP_RUN); gives CV = 100 − TANK_LEVEL
  • ENABLE := DOSE_PUMP_RUN parks the CV at MIN (0) whenever the pump permissive drops
  • LOW_TANK_LAMP := LOW_TANK_ALARM

I/O Table

Inputs

FLOW_RUNNING

Flow switch — water main active

BOOL · %I0.0

DOSE_START

Operator dose enable switch

BOOL · %I0.1

TANK_LEVEL

Chemical tank level 0–100%

REAL · %IW0

LOW_TANK_ALARM

Low tank float switch (<10%)

BOOL · %I0.2

Outputs

DOSE_PUMP_RUN

Dose pump run contactor

BOOL · %Q0.0

LOW_TANK_LAMP

Low tank alarm lamp

BOOL · %Q0.1

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1Dose pump starts when flow active and dose enabled

    FLOW_RUNNING + DOSE_START + tank at 50% -> pump runs at ~50% speed

  2. #2Dose pump stops when flow is lost

    FLOW_RUNNING goes false -> pump stops

  3. #3LOW_TANK_ALARM stops dosing and lights lamp

    LOW_TANK_ALARM while running -> pump stops, LOW_TANK_LAMP on

  4. #4Speed is inversely proportional to tank level

    Lower tank level -> higher pump speed

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in