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

Day 57 of 365 · Beginner · Month 3: First systems

Pressure control with the volume pump

Smooth instead of on/off: compute pump output from the pressure, limit it with clamp and guard against sensor failure.

Lesson 12 min Week 9

What you learn today

  • Compute pump output from pressure
  • clamp limits
  • NaN guard

A volume pump has two important LogicTypes: On and Setting – the flow in litres per tick. Instead of just switching it on and off, you can adjust the flow smoothly to the pressure. Then the tank does not overshoot the target.

Proportional controller

The idea: pump output = distance to target × factor.

sub flow TARGET press     # how far to go?
div flow flow 100         # 100 kPa distance = 1 litre/tick
clamp flow flow 0 10      # never below 0, never above 10

clamp r? value min max limits a value to a range. With an empty tank, flow would be huge – clamp turns it into 10. Above the target it would be negative – clamp turns it into 0.

Then the pump only needs to run when there is something to do:

sgtz on flow              # 1 if flow > 0

Guarding against NaN

If the pipe analyzer fails, Average returns NaN and flow becomes NaN. For a pump that is risky – who knows what the device does with “not a number”. So catch it explicitly:

snan missing press
select flow missing 0 flow   # NaN: 0
Tip

Compute first, then guard, then write – in that order the device never receives a nonsense value.

Note

The pipe analyzer’s prefab name is StructurePipeAnalysizer – the typo is in the game like that.

Diagram

Pump output depending on tank pressure 10 0 Setting (L/tick) 4000 5000 tank pressure in kPa clamp: at most 10 (target − pressure) / 100 off
The closer the tank gets to the target pressure, the slower the pump runs. clamp keeps the output between 0 and the maximum.

Exercise

Task

A pipe analyzer “Tank” measures the pressure, a volume pump “Fuellpumpe” tops it up. Target pressure 5000 kPa.

  • Pump Setting = (5000 − pressure) / 100, limited to 0 to 10
  • On = 1 if the output is greater than 0, otherwise 0
  • If the analyzer fails (NaN): Setting 0 and On 0

Hints

Hint 1

Three lines for the output: sub, div, clamp.

Hint 2

Catch NaN: snan missing press, then select flow missing 0 flow.

Hint 3

Finally sgtz on flow – only after the NaN guard.

Quiz

4 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