stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 172

Day 172 of 365 · Advanced · Month 6: Atmosphere and control

Making an airlock safe

What if the sensor fails or someone forces a door? A mutual interlock, a latched emergency mode and an acknowledge button make the airlock safe.

Lesson 18 min Week 25

What you learn today

  • Sensor failure
  • Never both doors open
  • Emergency mode

The airlock works. Then someone pulls the data cable to the sensor during a rebuild, or a teammate forces the outer door with a crowbar while there is still air inside. An airlock has to stay safe even when something goes wrong. For that it gets a safety layer that checks independently of the normal sequence – like the second threshold in the overheat protection.

Sensor failure

If the sensor is missing, lbn … Average returns NaN, and every comparison with NaN is 0. So build your conditions so that 1 means “allowed”: “door may open” rather than “door must stay shut”. Then a failure shuts everything by itself.

On top of that you remember the failure:

snanz ok press            # 1 = sensor delivers values
seqz tmp ok
or emerg emerg tmp        # remember the failure

If the sensor comes back shortly after, emerg still stays 1. A briefly cut cable should not go unnoticed.

Never both doors open

The pressure rules already exclude each other: the inner door needs a full chamber, the outer door an empty one. You do not rely on that alone – a wrongly named sensor or a teammate with a crowbar defeats it. That is why each door also checks the other one:

sge tmp press FULL       # chamber full?
seqz block outer         # outer door shut?
and block block tmp      # 1 = inner door may open
seqz block block         # lock = not allowed
sbn DOOR HASH("Innentuer") Lock block

Lock 1 locks the door against operation by hand. According to the Stationpedia an airlock door can only be opened with a crowbar as long as it is not locked. If both are open anyway, the chip shuts the outer door at once – it is the more dangerous one.

Warning

Only write when you have to step in. If the guard wrote Open 0 to the outer door every tick, it could never be opened again. That is why the closing sits behind a jump: only when both doors are open does the chip get past that line.

Emergency mode

Without a sensor there is only one safe state:

  • both doors shut (Open 0) and locked (Lock 1),
  • vent off,
  • warning light on.

Emergency mode only ends when the sensor delivers values again and someone presses the button “Quittung” – like the fault from week 20. Acknowledging without a sensor is not possible: and tmp tmp ok prevents it.

Note

If someone is standing in the chamber during emergency mode, they only get out after the acknowledgement. So hang one button “Quittung” in the chamber and one in the base. Same name, Average reads both: if one is pressed, the value is greater than 0.

Exercise

Task

A manual airlock: the doors are operated by hand, the vent at the console. Your chip is the guard. It reads the sensor “Schleuse”, both doors and the button “Quittung”.

  • Inner door locked (Lock 1) unless the chamber is full (from FULL) and the outer door is shut.
  • Outer door locked unless the chamber is empty (below EMPTY) and the inner door is shut.
  • If both are open anyway, the chip shuts the outer door.
  • If the sensor fails (NaN): emergency mode. Both doors shut and locked, vent “Schleuse” off, flashing light “Warnlicht” on.
  • Emergency mode stays until the sensor delivers values again and “Quittung” is pressed. Outside emergency mode the warning light is off.

The block for emergency mode is already at the bottom of the starter code.

Hints

Hint 1

Section 2: seqz tmp ok and or emerg emerg tmp. Acknowledge: sgtz tmp ack, and tmp tmp ok, select emerg tmp 0 emerg. Then bnez emerg emergency.

Hint 2

Inner door lock: sge tmp press FULL, seqz block outer, and block block tmp, seqz block block. The outer door the same way with slt and inner.

Hint 3

Both open: and tmp inner outer, then beqz tmp normal. Only otherwise does sbn DOOR HASH("Aussentuer") Open 0 run.

Hint 4

At normal: switch the warning light off and go back to start.

Quiz

5 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere