Skip to content

Commit

Permalink
motion_report: Don't negate step_distance on steppers with inverted d…
Browse files Browse the repository at this point in the history
…ir pin

When querying the stepper motion queue, the resulting "interval",
"count", and "add" are already normalized to the correct direction.
That is, the "count" field will be positive if moving in a positive
axis direction and negative if moving in the reverse direction.  So,
negating the step_distance field just complicates the readers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
  • Loading branch information
KevinOConnor committed Apr 3, 2024
1 parent 239f8e5 commit bedec55
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions klippy/extras/motion_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def _process_batch(self, eventtime):
mcu_pos = first.start_position
start_position = self.mcu_stepper.mcu_to_commanded_position(mcu_pos)
step_dist = self.mcu_stepper.get_step_dist()
if self.mcu_stepper.get_dir_inverted()[0]:
step_dist = -step_dist
d = [(s.interval, s.step_count, s.add) for s in data]
return {"data": d, "start_position": start_position,
"start_mcu_position": mcu_pos, "step_distance": step_dist,
Expand Down

0 comments on commit bedec55

Please sign in to comment.