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

Day 256 of 365 · Pro · Month 9: Logistics and greenhouse

Watering

Water for hydroponics: fill the watering line with a pump and hysteresis, compute the tank level from VolumeOfLiquid and report a shortage.

Lesson 18 min Week 37

What you learn today

  • Check the water supply
  • Fill lines
  • Report shortage

Hydroponics means the roots hang in water. If the line runs dry, the plant first grows more slowly and takes damage after a while. A chip keeps an eye on the water long before the Harvie's face turns sad.

Where the water is

Hydroponics trays hang on a liquid pipe. The hydroponics device reads the water that is standing in it right now:

LogicTypemeans
Pressurepressure of the contents
Temperaturetemperature of the water
RatioWatershare of water in the contents
TotalMolesamount of substance of the contents

For the whole line a liquid pipe analyzer (StructureLiquidPipeAnalyzer) is the right tool. It reads the same values and also VolumeOfLiquid, the volume of the liquid in litres.

Filling lines

The water comes from a liquid tank and flows through a liquid pump (StructureLiquidVolumePump) into the watering line. The chip switches the pump with hysteresis: on when the line pressure drops, off when it is back up. That way there is always water at the trays, but the line is not overfilled.

lbn press ANALYZER HASH("Giessleitung") Pressure Average
slt tmp press P_OFF     # below 300 kPa: keep pumping
and pump pump tmp
slt tmp press P_ON      # below 150 kPa: start
or pump pump tmp
sbn PUMP HASH("Giessen") On pump

The numbers are example values. Measure your line when it is well filled and set the limits a little below.

How full is the tank?

The tank itself has no logic any more: its kit builds an in-line tank that belongs to the pipe network. A second liquid pipe analyzer “Wassertank” on the tank line, i.e. before the pump, reports Volume, the capacity of that network in litres, and VolumeOfLiquid, the liquid inside. The quotient is the fill level:

lbn fill ANALYZER HASH("Wassertank") VolumeOfLiquid Average
lbn tmp ANALYZER HASH("Wassertank") Volume Average
div fill fill tmp       # 0 to 1

Reporting a shortage

Two messages belong here:

  1. Tank almost empty: fill level below 10 %. Time to melt ice or bring more water.
  2. Line stays empty: the pump runs, but the pressure does not rise. Then the tank is empty or the line leaks. A counter detects that: it counts up while the pump works and the pressure stays low, and drops to 0 as soon as one of the two is no longer true.
Warning

A failed analyzer returns NaN. Then you do not know how full the line is. The hysteresis above switches the pump off by itself on NaN – the shortage light should come on as well so somebody takes a look.

Tip

The water counts for the temperature too: according to the game code the plant checks whether its water is in the growth range. A line running outside over the Mars ground cools the roots.

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 pump moves water from the tank into the watering line, the analyzer measures the pressure there.

Exercise

Task

Build the watering:

  • pump “Giessen” on below 150 kPa in the analyzer “Giessleitung”, off above 300 kPa
  • display “Tank” shows the fill level at the analyzer “Wassertank” in whole percent, −1 without the analyzer
  • light “Wasser” on when the tank is below 10 %, the analyzer is missing or the pump runs for more than 20 ticks without the pressure getting above 150 kPa

Hints

Hint 1

Fill level: VolumeOfLiquid divided by Volume, times 100, rounded. On NaN use select to get −1.

Hint 2

−1 is less than 10 – slt short fill TANK_MIN then reports a missing analyzer by itself.

Hint 3

Counter: add time time tmp and then mul time time tmp – that way it drops to 0 as soon as tmp is 0.

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