#Solar Tracking & Power Systems Control v1
# by SemlerPDX Dec2025
define SolarPanels -539224550
define DaylightSensors 1076425094
define Generators 813146305
define Batteries -400115994
define ChargeMin 0.10 # 10%
define ChargeMax 0.50 # 50%
define SensorOffset 90 #0, 90, 180, or 270
# Threshold for "dark"
define IrradianceMin 1
define DawnVertical 165
define DawnHorizontal 180
main:
yield
#Range Based Toggle == IC10 Schmitt Trigger
lb r0 Batteries Ratio Average
lb r1 Generators On Maximum
select r1 r1 ChargeMax ChargeMin
slt r0 r0 r1
sb Generators On r0
lb r0 DaylightSensors SolarIrradiance Maximum
blt r0 IrradianceMin nightSleep
lb r0 DaylightSensors Vertical Maximum
lb r1 DaylightSensors Horizontal Maximum
add r0 r0 SensorOffset
add r1 r1 SensorOffset
sb SolarPanels Vertical r0
sb SolarPanels Horizontal r1
j main
nightSleep:
sb SolarPanels Vertical DawnVertical
sb SolarPanels Horizontal DawnHorizontal
j main
Comments
0 B
|👍
/👎
0 B
|👍
/👎
0 B
|👍
/👎
0 B
|👍
/👎