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

Day 139 of 365 · Advanced · Month 5: Memory and structure

Project: pump station with sequence

A pump station fills a basin, holds it, drains it again and watches every step for time. Faults stay until someone acknowledges them.

Project 40 min Week 20

What you learn today

  • Sequence fill–hold–drain
  • Timeout
  • Acknowledge faults

This week gave you all the building blocks for a step sequence: the state in a register, the jump table with a catch, the time per state and a fault that has to be acknowledged. The project puts them together into a plant that stands in many bases: a basin that is filled at the push of a button, held for a while and drained again – for example a buffer tank in which hot gas is meant to cool down before it moves on.

The plant

DevicePrefabName
Volume pump into the basinStructureVolumePump“Fuellpumpe”
Volume pump out of the basinStructureVolumePump“Leerpumpe”
Pipe analyzer on the basinStructurePipeAnalysizer“Becken”
ButtonStructureLogicButton“Start”
ButtonStructureLogicButton“Quittieren”
LED displayStructureConsoleLED5“Status” (state)
LED displayStructureConsoleLED5“Ursache” (cause)
Flashing lightStructureFlashingLight“Stoerung”

The step sequence

StateNo.runningmove on whentime limit
Ready0nothingbutton “Start” → Filling–
Filling1fill pumppressure ≥ 1000 kPa → Holdingover 60 ticks (30 s) → fault, cause 1
Holding2nothingafter 20 ticks (10 s) → Draining–
Draining3drain pumppressure < 10 kPa → Readyover 60 ticks (30 s) → fault, cause 2
Fault4flashing light“Quittieren” and analyzer present → Ready–

If the analyzer is missing, the plant goes from every state into the fault state with cause 3, all pumps off. An unknown state leads to cause 4. The display “Ursache” shows the first cause until it is acknowledged.

Setting the cause in the state block

The only new thing is that a transition into the fault state brings its reason along. For that the block sets a second register reason, which starts at 0 every tick:

s_filling:
sgt tmp ticks MAXFILL
select next tmp FAULT next
select reason tmp C_FILL reason
sge tmp pressure FULL
select next tmp HOLDING next
j output

In the output you only take over reason if the plant really goes into the fault state. If the basin does fill up in the last allowed tick, success wins and the cause stays empty. After that you latch as on day 137: select cause cause cause reason.

Milestones

  1. Start fills the basin, a full basin moves on to Holding
  2. Holding lasts 10 s, then the basin is drained, and empty means Ready again
  3. Filling takes too long: fault with cause 1, pumps off, flashing light on, Start has no effect
  4. Draining takes too long: fault with cause 2
  5. Unknown state: fault with cause 4, acknowledging leads back to Ready
  6. Analyzer gone: fault with cause 3, all pumps off, acknowledging has no effect
Tip

First build the sequence without times and without causes and get milestones 1 and 2 green. Then the time limits, then the fault. If you write everything at once, you end up hunting three bugs at the same time.

Project task

Task

Build the pump station following the tables above. Header, register plan and reading the inputs are done – reason is 0 every tick, ticks already counts up. Missing are the jump table with catch, the five state blocks and the output with counter reset, latch and all devices.

Milestones

  1. Milestone 1: fill until full
  2. Milestone 2: hold, drain, ready
  3. Milestone 3: filling takes too long
  4. Milestone 4: draining takes too long
  5. Milestone 5: unknown state and acknowledging
  6. Milestone 6: analyzer gone

Hints

Hint 1

Chain: five beq lines, then the catch with move next FAULT, move reason C_STATE and j output.

Hint 2

Filling and draining: first the time limit (sgt, two select for next and reason), then success. Holding: sge tmp ticks HOLDTIME.

Hint 3

Fault: and tmp ack ok, then next to READY and cause to 0 – both with select.

Hint 4

Output: without analyzer reason = C_SENSOR and next = FAULT; keep reason only if next = FAULT; latch; reset the counter; move state next; then all sbn.

Quiz

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

Complete the day

  • Passed all milestones of the project
  • 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