Chemical engineering / control lab

THE PURPLE MIXER // PID CHALLENGE

Mix red and blue streams to make perfect purple. Tune your controller, reject disturbances, and compete for the highest reproducible score.

TARGET 50.0% BLUEREADY

01 / LIVE MIXING PROCESS

Well-mixed tank • fixed volume
RED FEED1.00 L/s BLUE FEED0.20 L/s PRODUCTOUT BLUE FRACTION18.0%
Actual color
18.0%
Color error
+32.0 pp
Blue flow
0.20 L/s
Target purple50.0% blue + 50.0% redActual

LIVE RESPONSE

Same disturbance sequence every run
COLOR (left axis) & BLUE FLOW (right axis)ColorTargetFlowPrevious run

02 / CONTROLLER

Editable before run
Proportional gain Kp2.50
060
Integral time τiOFF
1 s (strong)∞ = OFF
Derivative time τdOFF
0 = OFF60 s
Use the same starting conditions and disturbances every time. Your PID settings are locked during each run so scores are directly comparable.

03 / CHALLENGE SCORE

RUN #—
Live projected quality scoreNOT STARTED
— / 100
Score appears as you run. Scores are based on tracking error, with penalties for aggressive valve movement.
On-spec production
—
Within ±2 percentage points
Best completed PID run
—
No completed runs yet
Production clock0 / 180 s
Incoming red feed: 1.00 L/s. Unknown disturbances? Not today — everyone receives the same ones.

🏁 The objective: Minimize the average difference between actual purple and target purple, while avoiding frantic valve movement.

⚡ Disturbances: Red feed changes at 55, 115, and 150 s. All runs use identical timing, initial color, and equipment.

🔁 Compare attempts: Select a previous run below to overlay its response. Try to beat your best PID score.

05 / RUN HISTORY & LEADERBOARD

Click a run to compare traces
History saves in this browser.
RunModeScoreOn-specKpτi (s)τd (s)Compare
No completed runs yet. Start the mixer to set the first score.

HOW THIS PROCESS WORKS

Simplified educational model

The red stream enters at a baseline of 1.00 L/s. The controller changes the blue feed (0–2.50 L/s). A perfectly mixed, fixed-volume tank discharges the combined feed.

We track the fraction of blue liquid in the tank. The actuator has a short lag, the color sensor has a short lag, and the PID uses ideal-form Kp, τi, and τd, with derivative-on-measurement filtering and anti-windup. τi at the far right represents infinite integral time (integral OFF); τd = 0 at the far left disables derivative action.

Every run starts at 18% blue, with the blue valve at 0.20 L/s. Red-flow disturbances are predetermined. Manual mode is scored but excluded from the PID best score.

The colors are visual representations of composition (not an exact optical mixing model). Final score = 100 × exp(−4 × mean absolute composition error − 0.07 × total variation in blue valve flow). History is stored locally on this device, not shared across students.