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

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

Generator by charge level

A generator that starts and stops by battery charge – with hysteresis so it does not keep switching, and with an eye on the fuel.

Lesson 12 min Week 10

What you learn today

  • Switch a generator with hysteresis
  • Keep an eye on fuel
  • not constantly on and off

The solid fuel generator delivers 20 kW – as long as solid fuel such as coal burns inside it. It should not run all the time, only when the batteries need it. And it should not switch on and off every minute.

The generator

LogicTypeMeaning
Onswitched on
PowerGenerationwhat it currently produces, in W

PowerGeneration is only above 0 when it is switched on and fuel is burning. If it is on and still produces nothing, it is empty.

Hysteresis on the charge

You know the pattern from heating: on below START, off from STOP, keep the state in between.

slt tmp share STOP         # not full enough yet?
and running running tmp
slt tmp share START        # empty enough to start?
or running running tmp
sbn GEN HASH("Generator") On running

With START 20 % and STOP 90 % the generator runs long stretches at a time. The further apart the limits, the less often it switches. It loses no fuel when switched off – the burn time already started is kept. Fuel is only wasted when the generator runs without anyone needing the power: it burns as long as it is on.

Keeping an eye on the fuel

The chip cannot look inside the generator, but it sees the consequences: switched on and no output. So that a short gap while refuelling does not trigger a false alarm, count the ticks without output and only warn after a while:

seqz tmp output            # producing nothing?
and tmp tmp running        # although it should run
select empty tmp empty 0   # otherwise counter to 0
add empty empty tmp
sgt warn empty 10          # longer than 5 seconds
Warning

The generator delivers its full output as soon as it runs. When the batteries are charging, 20 kW quickly flow through the cable – normal cable only holds 5 kW. Generator and batteries belong on heavy cable.

Note

If the battery value fails, both comparisons are false and the generator switches off. That way no fuel is wasted. Report the failure anyway, otherwise you stand in the dark at night without knowing why.

Exercise

Task

A generator by charge. On the network: station batteries “Akku”, solid fuel generator “Generator”, flashing light “Brennstoff”.

  • Charge = Ratio of the batteries, average (batteries of equal size).
  • Generator on below 20 %, off from 90 %, keep the state in between.
  • “Brennstoff” flashes when the generator should run but produces nothing for more than 10 ticks.
  • Without a battery value: generator off.

Hints

Hint 1

Hysteresis as for heating: slt against STOP with and, slt against START with or.

Hint 2

Read the output with lbn … PowerGeneration Average.

Hint 3

Counter: select empty tmp empty 0, then add empty empty tmp, then sgt against PATIENCE.

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