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

Day 209 of 365 · Pro · Month 7: Power and energy

Project: energy centre

The energy centre combines dashboard, minute history with peak value, remaining run time, load shedding and alarm in one chip.

Project 40 min Week 30

What you learn today

  • Dashboard, history and forecast together
  • Load shedding
  • Alarm

This week you built single building blocks: dashboard, history, forecast, grid coupling, faults. The energy centre puts the most important ones together into one chip.

The plant

DevicePrefabName
cable analyzerStructureCableAnalysizer“Hauptnetz”
two station batteriesStructureBattery“Akku”
three LED displaysStructureConsoleLED5“Erzeugung”, “Spitze”, “Restzeit”
wall lightsStructureWallLight“Komfort”
klaxonStructureKlaxon“Alarm”

Two rhythms in one chip

Some things have to happen every tick: dashboard, load shedding, alarm. Others only once per minute: history and forecast. The trick: the minute work sits at the end of the loop behind the counter. In 119 out of 120 ticks blt tick TICKS start jumps back before it.

add tick tick 1
blt tick TICKS start
move tick 0

What the history stores

Every minute the chip stores the loss of charge of that minute in the stack (ten slots). “Spitze” shows the worst minute in kJ. That way you see in the morning whether something unusual drew power during the night.

The rules

  • Dashboard: “Erzeugung” shows PowerPotential, rounded, in mode DisplayMode.Power.
  • Remaining time: charge divided by the loss of the last minute, rounded down, in mode DisplayMode.Minutes. −1 while charging or idle.
  • Load shedding: “Komfort” goes off below 30 % and only comes back from 50 %.
  • Alarm: the klaxon plays Sound.PowerLow when the remaining time is between 0 and 30 minutes or no batteries are there.

Milestones

  1. Dashboard with unit
  2. History: the peak of the last ten minutes in kJ
  3. Forecast of the remaining time
  4. Load shedding with hysteresis
  5. Alarm on a tight reserve and on missing batteries
Tip

minutes starts at −1. Otherwise the alarm would go off in the first minute with minutes 0 before anything has been measured.

Note

If the batteries are missing, Ratio Average returns NaN: comfort goes off because sge with NaN gives 0. The capacity Maximum Sum is 0, so alarm. Both follow from the rules, without a special case.

Diagram

The stack with its pointer slot 0 10 slot 1 20 slot 2 30 slot 3 slot 4 sp = 3 next free slot push 40 pop r0 r0 = 30 last in, first out
The history stores the loss of charge for every minute. The peak is the worst minute of the last ten.

Project task

Task

Build the energy centre following the rules above. defines, aliases and start values are already there, the four sections are missing.

Milestones

  1. Milestone 1: dashboard with unit
  2. Milestone 2: peak of the last minutes
  3. Milestone 3: forecast the remaining time
  4. Milestone 4: load shedding with hysteresis
  5. Milestone 5: alarm

Hints

Hint 1

Every tick: dashboard, load shedding (sge/and, sge/or) and alarm.

Hint 2

Then the minute counter with blt tick TICKS start; behind it loss, poke, search loop with get … db.

Hint 3

Peak in kJ: divide by 1000 and round. Remaining time as yesterday with two select … -1.

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

Esc
↑ ↓ selectEnter open/ opens search anywhere