extruder: Add a SET_EXTRUDER_ROTATION_DISTANCE command

Support altering the extruder distance using the higher-level
rotation_distance.  This is in preparation for removal of the
SET_EXTRUDER_STEP_DISTANCE command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-01-29 14:13:26 -05:00
parent 6d7c03365a
commit 189188e3ca
5 changed files with 55 additions and 23 deletions

View file

@ -54,7 +54,8 @@ class EndstopPhase:
self.name = config.get_name().split()[1]
# Obtain step_distance and microsteps from stepper config section
sconfig = config.getsection(self.name)
self.step_dist = stepper.parse_step_distance(sconfig)
rotation_dist, steps_per_rotation = stepper.parse_step_distance(sconfig)
self.step_dist = rotation_dist / steps_per_rotation
self.phases = sconfig.getint("microsteps", note_valid=False) * 4
self.phase_calc = PhaseCalc(self.printer, self.name, self.phases)
# Register event handlers