The cabin CO₂ scrubber is a proportional feedback loop: crew exhale CO₂ at a fixed production rate P, and a scrubber removes it at a commanded rate R(t) that tries to hold the cabin at a target level.
dCO2/dt = P − R(t)
R(t) = clamp( Kp · ( CO2(t − τ) − target ), 0, Rmax )
τ = round-trip light time = 2 · distance / c
In Ground Control mode the commanded rate uses a CO₂ reading from τ seconds ago — a real radio signal cannot beat the speed of light, so that is how stale the telemetry is by the time a command gets back. Near Earth τ ≈ 0 and the loop tracks the target smoothly. As distance grows toward Mars (τ up to ≈ 42 minutes round trip at maximum range), the controller keeps "correcting" a cabin state that no longer exists — the classic instability a pure time delay adds to proportional feedback, with oscillation risk growing once the product Kp·τ approaches order 1 (a numerical check of this exact loop confirms the ringing sets in around Kp·τ ≈ 1.5, matching the textbook π/2 threshold for a pure-delay proportional loop). In Onboard Autonomous mode the same controller reads the current cabin CO₂ with τ = 0, so it stays well-behaved at any gain.
- Distance — sets the light-time delay (log scale, from LEO-like proximity to Mars maximum range ≈ 2.7 AU).
- Gain Kp — how aggressively the scrubber reacts to a CO₂ error; higher gain reacts faster but destabilizes sooner under delay.
- Crew size — sets the CO₂ production load the scrubber has to keep up with.
- Scrubber capacity Rmax — the hardware ceiling on removal rate; a loop that saturates against this ceiling under delay settles into a bounded limit cycle instead of unbounded blow-up.
- Target CO₂ — the setpoint the controller aims for; since this is a pure proportional loop (no integral term) it always settles slightly above target by P/Kp when stable — a textbook proportional-control offset.
- Radio-link panel — drag to pan, scroll/pinch to zoom; blue dots are telemetry (spacecraft → Earth), orange dots are commands (Earth → spacecraft).
- Phase portrait — plots scrubber rate against CO₂ error; a shrinking inward spiral is a stable loop, a fixed loop is a bounded limit cycle, a growing spiral is diverging. Drag to pan, scroll/pinch to zoom.
Note on the 3D sibling: its "How it works" panel documents R(t)=Kp·error directly, but its code actually computes removal = gain·error·0.01 — the real proportional constant used in the ODE is 100× smaller than the number shown on the gain slider. Verified numerically here (see below): the ring-up threshold Kp·τ≈π/2 only lines up with the 3D sim's behaviour once that hidden ×0.01 factor is applied. This 2D version's Kp slider is the exact constant used in the ODE above, so the formula and the code agree.