mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-22 22:24:02 -06:00
stepper: Store pointers to step_const and step_delta in PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
fc1d690d75
commit
eecf3b6ea8
5 changed files with 28 additions and 35 deletions
|
@ -107,7 +107,7 @@ class CartKinematics:
|
|||
axis_d = move.axes_d[i]
|
||||
if not axis_d:
|
||||
continue
|
||||
mcu_stepper = self.steppers[i].mcu_stepper
|
||||
step_const = self.steppers[i].step_const
|
||||
move_time = print_time
|
||||
start_pos = move.start_pos[i]
|
||||
axis_r = abs(axis_d) / move.move_d
|
||||
|
@ -117,19 +117,17 @@ class CartKinematics:
|
|||
# Acceleration steps
|
||||
if move.accel_r:
|
||||
accel_d = move.accel_r * axis_d
|
||||
mcu_stepper.step_const(
|
||||
move_time, start_pos, accel_d, move.start_v * axis_r, accel)
|
||||
step_const(move_time, start_pos, accel_d,
|
||||
move.start_v * axis_r, accel)
|
||||
start_pos += accel_d
|
||||
move_time += move.accel_t
|
||||
# Cruising steps
|
||||
if move.cruise_r:
|
||||
cruise_d = move.cruise_r * axis_d
|
||||
mcu_stepper.step_const(
|
||||
move_time, start_pos, cruise_d, cruise_v, 0.)
|
||||
step_const(move_time, start_pos, cruise_d, cruise_v, 0.)
|
||||
start_pos += cruise_d
|
||||
move_time += move.cruise_t
|
||||
# Deceleration steps
|
||||
if move.decel_r:
|
||||
decel_d = move.decel_r * axis_d
|
||||
mcu_stepper.step_const(
|
||||
move_time, start_pos, decel_d, cruise_v, -accel)
|
||||
step_const(move_time, start_pos, decel_d, cruise_v, -accel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue