What you learn today
- Temperature, CO₂ and light for plants
- Limits
- Target ranges
A potato in a cold greenhouse grows more slowly, without CO₂ hardly at all. Before you control anything, you need to know what the plant wants and what the chip can measure of it.
What plants need
The game data (plantliferequirements.xml) describes a comfort range for every plant. For most crops:
| Quantity | game data | a target range from it |
|---|---|---|
| Temperature | centre at 25 °C | 20 to 30 °C |
| Pressure | centre at 75 kPa | 50 to 100 kPa |
| CO₂ | is breathed in | at least 1 % of the air |
| Light | light and dark time per day | grow light or sun |
There are exceptions: cocoa likes it warmer with a centre at 35 °C, switchgrass sits at 30 °C. Mushrooms work the other way round, breathing in oxygen and out CO₂, and need no light. The exact limits also depend on the genes of the individual plant. The Stationpedia shows them on the plant's page.
Plants breathe the room air. So a gas sensor in the greenhouse measures what matters. Then there is the water in the tray: its temperature has to be in the growth range as well.
CO₂: when is it enough?
In the game code a plant breathes in nothing below 0.1 % CO₂ and fully from 1 %, in between it rises evenly. A greenhouse with plain breathing air therefore slows the plants down. A digital valve on a CO₂ line keeps the share up:
slt tmp co2 CO2_CLOSE # below 4 %: stay open
and valve valve tmp
slt tmp co2 CO2_OPEN # below 2 %: open
or valve valve tmp
sbn VALVE HASH("CO2") On valve
Light
A grow light (StructureGrowLight) needs 70 W and lights the trays near it, sun through windows counts as well. How long the light should be on comes next week.
Target range and limit
Tell two kinds of limits apart:
- Target range: this is where the value should be. The control works with hysteresis inside this range, for example heater on below 20 °C and off above 24 °C.
- Limit: beyond it things get dangerous. Below 15 °C or above 35 °C there is an alarm, whatever the control is doing.
slt alarm temp T_MIN # too cold
sgt tmp temp T_MAX # too warm
or alarm alarm tmp
If the gas sensor fails, lbn with Average returns NaN. Every comparison with NaN gives 0 – the heater would simply stay off and nobody would notice. Check the sensor with snanz and switch on the alarm on a failure.
Diagram
Exercise
Task
Control the greenhouse with the gas sensor “Gewaechshaus”:
- heater “Gewaechshaus” on below 20 °C, off above 24 °C
- valve “CO2” open below 2 % CO₂, closed from 4 %
- light “Klima” on below 15 °C, above 35 °C or when the sensor is missing
- without the sensor: heater off, valve closed
Hints
Hint 1
Both hystereses follow the same pattern: slt/and with the upper limit, slt/or with the lower one.
Hint 2
Then and … ok so that everything is off without the sensor.
Hint 3
Alarm: slt with T_MIN, sgt with T_MAX and seqz tmp ok, all with or.
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