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). 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_PUMP_SPEED (REAL 0–100%) is proportional to (100 – TANK_LEVEL): empty 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 and DOSE_PUMP_SPEED go to 0

Hints

  • DOSE_PUMP_RUN := FLOW_RUNNING AND DOSE_START AND NOT LOW_TANK_ALARM
  • DOSE_PUMP_SPEED := DOSE_PUMP_RUN * (100.0 - TANK_LEVEL)
  • LOW_TANK_LAMP := LOW_TANK_ALARM
  • Clamp DOSE_PUMP_SPEED between 0.0 and 100.0

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

DOSE_PUMP_SPEED

Dose pump speed 0–100%

REAL · %QW0

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