motion_report: Improve "motion_report/dump_stepper" during homing

Step timing is reset when stepper.set_position() is called.  Detect
that case and ensure future steps after set_position start on a new
block.  This simplifies the timing for users of the data.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-10-13 13:29:24 -04:00
parent 95b0ebf4c7
commit 3215e3a2aa

View File

@@ -47,6 +47,11 @@ class DumpStepper:
data, cdata = self.get_step_queue(self.last_batch_clock, 1<<63)
if not data:
return {}
for i, d in enumerate(data):
if not d.step_count:
# End block on a set_position marker to simplify timing
del data[i+1:]
break
clock_to_print_time = self.mcu_stepper.get_mcu().clock_to_print_time
first = data[0]
first_clock = first.first_clock
@@ -56,8 +61,8 @@ class DumpStepper:
mcu_pos = first.start_position
start_position = self.mcu_stepper.mcu_to_commanded_position(mcu_pos)
step_dist = self.mcu_stepper.get_step_dist()
d = [(s.interval, s.step_count, s.add) for s in data]
return {"data": d, "start_position": start_position,
tdata = [(s.interval, s.step_count, s.add) for s in data]
return {"data": tdata, "start_position": start_position,
"start_mcu_position": mcu_pos, "step_distance": step_dist,
"first_clock": first_clock, "first_step_time": first_time,
"last_clock": last_clock, "last_step_time": last_time}