Quantize manual rod steps to 0.025

This commit is contained in:
Codex Agent
2025-11-23 23:12:13 +01:00
parent d6bb0543b6
commit 2c3f9e3b45
4 changed files with 52 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ class ControlSystem:
return self.rod_fraction
def set_rods(self, fraction: float) -> float:
self.rod_target = clamp(fraction, 0.0, 0.95)
self.rod_target = self._quantize_manual(fraction)
self._advance_banks(self.rod_target, 0.0)
LOGGER.info("Manual rod target set to %.3f", self.rod_target)
return self.rod_target
@@ -127,6 +127,11 @@ class ControlSystem:
def _sync_fraction(self) -> None:
self.rod_fraction = self.effective_insertion()
def _quantize_manual(self, fraction: float) -> float:
step = constants.ROD_MANUAL_STEP
quantized = round(fraction / step) * step
return clamp(quantized, 0.0, 0.95)
def save_state(
self,