What you learn today
- Read wind turbines
- Output fluctuates
- Batteries buffer
Evening on Mars: the solar panels deliver nothing any more, outside three wind turbines are turning. How much power is arriving right now – and can the base rely on it?
Two turbines, one LogicType
| Device | Prefab | normally up to | in a storm up to |
|---|---|---|---|
| Wind turbine | StructureWindTurbine | 1,000 W | 20,000 W |
| Upright wind turbine | StructureUprightWindTurbine | 500 W | 1,000 W |
Both reveal only one thing via logic: PowerGeneration, the output at this moment. No On, no Setting – a turbine cannot be switched off, only deconstructed.
The output depends on the pressure of the outside air and on the wind strength. The wind strength drifts slowly up and down, so the output fluctuates all the time. A turbine inside a closed room delivers 0 W, and so does one in a vacuum. On Mars with its thin air it stays far below its maximum.
Adding up with Sum
Power really adds up. Sum is right here:
lbn now WIND HASH("Windpark") PowerGeneration Sum
If there is no turbine with that name on the network, Sum returns 0, not NaN. For a power display that is even the right answer: no wind, no power.
Smoothing instead of twitching
If you switch directly on now, you switch on every gust. A smoothed value is better, as you know from smoothing: every tick only catches up part of the difference.
sub diff now smooth
mul diff diff FACTOR
add smooth smooth diff
With FACTOR 0.1 the average needs a good 20 ticks, about ten seconds, to follow a jump. A short lull hardly counts any more.
Batteries buffer
Wind is moody. That is why loads never hang directly on the turbine output but on the battery: the turbines charge, the loads discharge, and your chip decides by the batteries' Ratio when a generator steps in. The wind display is information, not a switch.
In a storm a large wind turbine delivers up to 20,000 W according to the game code. A normal cable carries 5,000 W. A wind farm belongs on heavy cable or behind a transformer – more on that in two days.
Diagram
Exercise
Task
Three wind turbines are named “Windpark”. Show the sum of their output on “Wind” and the smoothed value (FACTOR 0.1 per tick) on “WindMittel”. The light “Flaute” goes on while the smoothed value is below 200 W.
Hints
Hint 1
The sum is already in now – first write it to “Wind”.
Hint 2
Smoothing: sub diff now smooth, mul diff diff FACTOR, add smooth smooth diff.
Hint 3
Calm: slt calm smooth CALM and write it to the light.
Quiz
5 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