dev #14

Merged
Arcmyx merged 4 commits from dev into main 2026-01-09 19:21:14 +00:00
Showing only changes of commit 6de3ebda08 - Show all commits

View File

@@ -4,7 +4,6 @@ import umath
class MotorDiagnostics:
def __init__(self, hub, motorclass):
self.testmotor = None
self.motorclass = motorclass
self.port_map = {
"A": Port.A,
"B": Port.B,
@@ -13,7 +12,7 @@ class MotorDiagnostics:
"E": Port.E,
"F": Port.F,
}
self.motorclass = motorclass
def stdev(self, vals):
DATA = vals
if len(DATA) < 2:
@@ -37,7 +36,7 @@ class MotorDiagnostics:
STABILITY = max(0, 100 - (stdev_speed / desired) * 100)
# Normalize load: map 10 to 20 as baseline (around 0%), 200 as max (around 100%)
BASELINE = 15 # midpoint of idle range
BASELINE = 10 # midpoint of idle range
MAX_OBSERVED = 200 # heavy load/stall
NORMALIZED_LOAD = max(0, avg_load - BASELINE)
LOAD_PCT = min(100, (NORMALIZED_LOAD / (MAX_OBSERVED - BASELINE)) * 100)