What you learn today
- Redundant sensors
- Emergency mode
- Clean restart
The cold room holds the supplies for the next Martian winter. If the cooling fails for one night, everything is lost. This week you build the control that expects everything you have learned: sensors fail, setpoints are nonsense, chips get reinserted.
The setup
| Device | Prefab | Name |
|---|---|---|
| three gas sensors | StructureGasSensor | “Kuehl_A”, “Kuehl_B”, “Kuehl_C” |
| wall cooler | StructureWallCooler | “Kuehlhaus” |
| Logic Memory for the setpoint | StructureLogicMemory | “Kuehl_Soll” |
| LED display temperature | StructureConsoleLED5 | “Kuehlhaus” |
| LED display mode | StructureConsoleLED5 | “Kuehl_Modus” |
| flashing light | StructureFlashingLight | “Kuehl_Stoerung” |
The rules
- Measure: the chip only averages the valid sensors. A failed sensor does not count.
- Cool: setpoint in °C from “Kuehl_Soll”. The cooler switches on 2 K above the setpoint and off 2 K below it.
- Report: if a sensor is missing, “Kuehl_Stoerung” flashes. The control keeps running with the others.
- Emergency mode: below two valid sensors the cooler runs all the time, “Kuehl_Modus” shows 1 instead of 0.
- Restart: before the loop the setpoint is checked (−5 to 10 °C, otherwise 4 °C) and written back, and the cooler starts on. Better briefly too cold than not cooled at all.
- Display: “Kuehlhaus” shows the mean in °C, −999 without a valid sensor.
Milestones
- Cooling with hysteresis around the setpoint.
- One sensor fails: report, but normal operation.
- Two sensors fail: emergency mode.
- Clean restart with a checked setpoint.
For the mean of the valid sensors you count them with snanz and only add their values: select tmp tmp tb 0 turns a failed sensor into a 0 that does not distort the sum. You divide by the number of valid ones.
With zero valid sensors the mean is 0 / 0 = NaN. Here that is even intended: all comparisons with NaN are 0, the emergency mode takes over. But the display has to catch it.
Project task
Task
Build the fail-safe cold room control according to the rules above.
Milestones
- Milestone 1: cooling with hysteresis
- Milestone 2: one sensor fails
- Milestone 3: emergency mode
- Milestone 4: clean restart
Hints
Hint 1
Start part before start:: check the setpoint as on day 319, write it back, convert to Kelvin, cooler on.
Hint 2
Mean: snanz per sensor, select … 0 for the sum, div mean sum n.
Hint 3
Emergency mode: slt ok n 2, then or on on ok – and ok straight to “Kuehl_Modus”.
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