We are currently experiencing issues with email delivery; this is being resolved as quickly as possible.

stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Final project: automatic airlock

Chapter 7 · Pro

Final project: automatic airlock

Everything together: a lever, two doors, a vent, a sensor – and no door opens while the pressure is wrong.

Lesson 18 of 18 20 min

Time for your masterpiece. An airlock is the classic: program it wrong and you notice at the latest when your base vents into space.

The in-game setup

DevicePrefabName
LeverStructureLogicSwitch“Richtung” (Setting 1 = going out, 0 = going in)
Gas sensor inside the airlockStructureGasSensor“Schleuse”
Active vent inside the airlockStructureActiveVent“Schleuse”
Inner doorStructureAirlock“Innentuer”
Outer doorStructureAirlock“Aussentuer”

The vent has two directions via Mode: Vent.Outward (0) blows from the pipe into the airlock, Vent.Inward (1) sucks the airlock empty.

The rules

Going out (lever = 1):

  • Inner door closed.
  • Vent sucks (Mode 1) until the pressure is below 1 kPa, then off.
  • Outer door opens only when the pressure is below 1 kPa.

Going in (lever = 0):

  • Outer door closed.
  • Vent blows (Mode 0) until the pressure reaches at least 100 kPa, then off.
  • Inner door opens only when the pressure is at least 100 kPa.

Sensor gone (NaN): vent off, both doors closed.

Think in states, not sequences

You do not have to work through steps one after another. Every tick the chip reads lever and pressure and computes how each device should be right now:

slt empty press EMPTY     # 1 = airlock empty
sge full press FULL       # 1 = airlock full
seqz tmp out              # going in?
and tmp tmp full          # ... and full?
sbn DOOR HASH("Innentuer") Open tmp

With seqz, and, or and select from the earlier lessons you build the remaining rules the same way.

Tip

In the IC10 coder you can bring the airlock to life with couplings in the simulator: vent “On” lowers or raises the pressure every tick. Then you watch the airlock work in the trend view.

Diagram

Airlock layout Base 101 kPa Outside 0 kPa Airlock Inner door Outer door Sensor Vent sucks out / blows in Lever “Richtung” 1 = out: inner shut, pump down, outer open 0 = in: outer shut, fill up, inner open
The airlock knows two directions. The lever chooses one, the pressure decides which door may open and whether the vent works.

Exercise

Task

Program the airlock following the rules above. All devices are on the data network, the names are in the table. The test plays a complete cycle out and back in – plus a sensor failure.

Hints

Hint 1

First three helper values: snanz ok press (1 = sensor present), slt empty press EMPTY, sge full press FULL.

Hint 2

Inner door: open exactly when not going out (seqz tmp out) and full. Outer door: going out and empty.

Hint 3

The vent direction is simply the lever value: sbn VENT HASH("Schleuse") Mode out.

Hint 4

Vent on: going out “not empty yet”, going in “not full yet” – select tmp out notEmpty notFull picks it. Finally “and” it with ok.

Esc
↑ ↓ selectEnter open/ opens search anywhere