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

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

Solar tracking

Panels that follow the daylight sensor: convert angles, limit them to the panel's range and drive to a parking position at night. And why 30° of error already costs half.

Lesson 18 min Week 27

What you learn today

  • Make panels follow the sensor
  • Convert angles
  • Night parking position

A fixed solar panel only delivers full output briefly around noon. A tracked panel faces the right way all day – if the chip translates the angles correctly.

What a wrong angle costs

According to the game code (SolarPanelArm) a panel's efficiency is 1 minus the distance between its facing direction and the direction to the sun. For a deviation θ that means 1 − 2 · sin(θ/2):

DeviationEfficiency (Ratio)
0°100 %
10°83 %
30°48 %
60°0 %

So from 60° of error the panel delivers nothing at all. Tracking pays off a lot.

What the panel accepts

LogicTypeRange
Horizontal0 … 360 degrees, larger values are wrapped onto the circle
Vertical15 … 165 degrees, limited outside
Ratioalignment efficiency, 0 … 1 (read only)
Chargecurrent output in W (read only)

The panel turns slowly towards the new value. It does no harm to write every tick. Only a panel with a joint can be tracked: flat and angled panels do not turn at all.

Converting angles

Sensor and panel measure in different frames of reference. What has proved itself: orient the sensor exactly like the panels, take Horizontal over directly and convert Vertical with an offset:

mul v v DIRECTION   # 1 or -1
add v v OFFSET      # e.g. 90
clamp v v V_MIN V_MAX

The starting values 90 and −1 come from the IC10 coder's “Solar tracking” template. If Ratio stays clearly below 1 at noon, OFFSET or DIRECTION does not match your build – then adjust them there, not in the code.

Parking at night

Without light (Activate 0) the field drives to a parking position towards the sunrise. Then the morning harvest starts without a long swing.

Warning

If the sensor fails, all angles are NaN. Writing NaN to a panel is the worst thing you can do. That is why bnan h start jumps back before every write – the panels simply stay put.

Note

How sensor and panel angles relate depends on how they are built and cannot be read from the game code alone. Measure it once at noon and put the matching values into the defines.

Exercise

Task

The daylight sensor “Sonne” steers the panels “Solar”.

  • Day: panel Horizontal = sensor Horizontal, panel Vertical = 90 − sensor Vertical, limited to 15 … 165
  • Night (Activate 0): parking position 90 / 60
  • Sensor gone: the panels keep their position

Hints

Hint 1

First bnan h start – without a sensor nothing is written.

Hint 2

Vertical: mul v v DIRECTION, add v v OFFSET, clamp v v V_MIN V_MAX.

Hint 3

Parking: select h light h PARK_H and the same for v.

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