FA-93626 / Solar tracker geometry / Open access
Cross-axis slope aware backtracking: angle relative to slope · case 01
Rows backtrack on the downhill side when they should on the uphill side.
ROOT CAUSE
The slope is added to the rotation instead of subtracted.
VERIFIED REPAIR
Evaluate cos(ideal - cross_tilt).
Unsuccessful approach: Ignoring the slope in the shading test backtracks as if the ground were flat.
Case contract
Rows on terrain with cross-axis slope cross_tilt degrees. dist = 1/(gcr*cos(cross_tilt)); temp = dist*cos(ideal - cross_tilt). When temp < 1 the angle becomes ideal - sign(ideal)*acos(max(temp, -1)) degrees, else ideal. The result is then clamped to +-max_angle. Return the angle rounded to 3.
Why this case matters
Single-axis and dual-axis solar trackers turn a sun direction into actuator commands; a sign, frame or limit mistake points a whole plant away from the sun or into a mechanical stop.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ideal, gcr, cross_tilt, max_angle):
dist = 1 / (gcr * math.cos(math.radians(cross_tilt)))
temp = dist * math.cos(math.radians(ideal + cross_tilt))
if temp < 1:
theta = ideal - math.copysign(math.degrees(math.acos(max(temp, -1.0))), ideal)
else:
theta = ideal
theta = max(-max_angle, min(max_angle, theta))
return round(theta, 3)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [80, 0.3, -10, 55], -10.0],
['regression: angle relative to slope (partial repair)', [-60, 0.5, 5, 50], -28.045],
['control 1', [-45, 0.5, -5, 50], -45], ['control 2', [-60, 0.3, 0, 60], -60]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.5, -5, 55], 28.045],
['regression: angle relative to slope (partial repair)', [80, 0.4, 10, 60], 50.255],
['control 1', [80, 0.4, 0, 60], 15.729], ['control 2', [-80, 0.4, 15, 75], 23.037]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.4, 15, 55], 55],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 15, 60], 2.496],
['control 1', [0, 0.4, -5, 55], 0], ['control 2', [70, 0.4, -5, 75], 20.505]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-80, 0.4, -10, 75], -50.255],
['regression: angle relative to slope (partial repair)', [80, 0.3, -5, 55], 6.955],
['control 1', [-60, 0.4, -5, 50], -50], ['control 2', [0, 0.4, -5, 60], 0]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-70, 0.3, -5, 60], -60],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 5, 75], -40.0],
['control 1', [-80, 0.5, 0, 75], -10.322], ['control 2', [-45, 0.4, 15, 50], -45]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal: flat terrain matches plain backtracking | -38.765 | -38.765 | Passed |
| boundary: slope-facing noon | 0 | 0 | Passed |
| boundary: clamp after backtracking | 50 | -10.0 | Failed |
| regression: angle relative to slope | 55 | -10.0 | Failed |
| regression: angle relative to slope (partial repair) | -50 | -28.045 | Failed |
| control 1 | -45 | -45 | Passed |
| control 2 | -60 | -60 | Passed |
SHA-256 / 64af543873ddbc7dff482c11dcd75df16eaef92d9d0856831a7c2be84c2f60f6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ideal, gcr, cross_tilt, max_angle):
dist = 1 / (gcr * math.cos(math.radians(cross_tilt)))
temp = dist * math.cos(math.radians(ideal))
if temp < 1:
theta = ideal - math.copysign(math.degrees(math.acos(max(temp, -1.0))), ideal)
else:
theta = ideal
theta = max(-max_angle, min(max_angle, theta))
return round(theta, 3)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [80, 0.3, -10, 55], -10.0],
['regression: angle relative to slope (partial repair)', [-60, 0.5, 5, 50], -28.045],
['control 1', [-45, 0.5, -5, 50], -45], ['control 2', [-60, 0.3, 0, 60], -60]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.5, -5, 55], 28.045],
['regression: angle relative to slope (partial repair)', [80, 0.4, 10, 60], 50.255],
['control 1', [80, 0.4, 0, 60], 15.729], ['control 2', [-80, 0.4, 15, 75], 23.037]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.4, 15, 55], 55],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 15, 60], 2.496],
['control 1', [0, 0.4, -5, 55], 0], ['control 2', [70, 0.4, -5, 75], 20.505]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-80, 0.4, -10, 75], -50.255],
['regression: angle relative to slope (partial repair)', [80, 0.3, -5, 55], 6.955],
['control 1', [-60, 0.4, -5, 50], -50], ['control 2', [0, 0.4, -5, 60], 0]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-70, 0.3, -5, 60], -60],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 5, 75], -40.0],
['control 1', [-80, 0.5, 0, 75], -10.322], ['control 2', [-45, 0.4, 15, 50], -45]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal: flat terrain matches plain backtracking | -38.765 | -38.765 | Passed |
| boundary: slope-facing noon | 0 | 0 | Passed |
| boundary: clamp after backtracking | 25.998 | -10.0 | Failed |
| regression: angle relative to slope | 25.998 | -10.0 | Failed |
| regression: angle relative to slope (partial repair) | -50 | -28.045 | Failed |
| control 1 | -45 | -45 | Passed |
| control 2 | -60 | -60 | Passed |
SHA-256 / 8f50a3d09f28401db388771a5827fefd77814721a6b1f2661ae124207de002a6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ideal, gcr, cross_tilt, max_angle):
dist = 1 / (gcr * math.cos(math.radians(cross_tilt)))
temp = dist * math.cos(math.radians(ideal - cross_tilt))
if temp < 1:
theta = ideal - math.copysign(math.degrees(math.acos(max(temp, -1.0))), ideal)
else:
theta = ideal
theta = max(-max_angle, min(max_angle, theta))
return round(theta, 3)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [80, 0.3, -10, 55], -10.0],
['regression: angle relative to slope (partial repair)', [-60, 0.5, 5, 50], -28.045],
['control 1', [-45, 0.5, -5, 50], -45], ['control 2', [-60, 0.3, 0, 60], -60]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.5, -5, 55], 28.045],
['regression: angle relative to slope (partial repair)', [80, 0.4, 10, 60], 50.255],
['control 1', [80, 0.4, 0, 60], 15.729], ['control 2', [-80, 0.4, 15, 75], 23.037]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [60, 0.4, 15, 55], 55],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 15, 60], 2.496],
['control 1', [0, 0.4, -5, 55], 0], ['control 2', [70, 0.4, -5, 75], 20.505]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-80, 0.4, -10, 75], -50.255],
['regression: angle relative to slope (partial repair)', [80, 0.3, -5, 55], 6.955],
['control 1', [-60, 0.4, -5, 50], -50], ['control 2', [0, 0.4, -5, 60], 0]],
[['normal: flat terrain matches plain backtracking', [-70, 0.4, 0, 60], -38.765],
['boundary: slope-facing noon', [0, 0.4, 10, 60], 0],
['boundary: clamp after backtracking', [80, 0.3, -10, 50], -10.0],
['regression: angle relative to slope', [-70, 0.3, -5, 60], -60],
['regression: angle relative to slope (partial repair)', [-70, 0.3, 5, 75], -40.0],
['control 1', [-80, 0.5, 0, 75], -10.322], ['control 2', [-45, 0.4, 15, 50], -45]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal: flat terrain matches plain backtracking | -38.765 | -38.765 | Passed |
| boundary: slope-facing noon | 0 | 0 | Passed |
| boundary: clamp after backtracking | -10.0 | -10.0 | Passed |
| regression: angle relative to slope | -10.0 | -10.0 | Passed |
| regression: angle relative to slope (partial repair) | -28.045 | -28.045 | Passed |
| control 1 | -45 | -45 | Passed |
| control 2 | -60 | -60 | Passed |
SHA-256 / 8378eb4b083aa738033d6125b7d6d8b4b2567b7080c74c10c6d48d0df1ddaa30
Verification & scope
Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:51:56.831553+00:00.
Case digest / 5c3d8e3f76feb7f4d7239d7c8941d6ed66adc83a31bfad1dbc267ac5d645dd5d