mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-05 04:54:11 -06:00
toolhead: Specify maximum acceleration and velocity in toolhead class
Change the config file so the maximum accel and velocity are specified in the "printer" section instead of the individual "stepper" sections. The underlying code limits the velocity and accel of the toolhead relative to the print object, so it makes sense to configure the system that was as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
fcaf359e89
commit
c49d3fdb17
8 changed files with 52 additions and 53 deletions
|
@ -11,11 +11,13 @@ class PrinterExtruder:
|
|||
self.heater = heater.PrinterHeater(printer, config)
|
||||
self.stepper = stepper.PrinterStepper(printer, config, 'extruder')
|
||||
self.pressure_advance = config.getfloat('pressure_advance', 0.)
|
||||
self.max_e_velocity = config.getfloat('max_velocity')
|
||||
self.max_e_accel = config.getfloat('max_accel')
|
||||
self.need_motor_enable = True
|
||||
self.extrude_pos = 0.
|
||||
def build_config(self):
|
||||
self.heater.build_config()
|
||||
self.stepper.set_max_jerk(9999999.9)
|
||||
self.stepper.set_max_jerk(9999999.9, 9999999.9)
|
||||
self.stepper.build_config()
|
||||
def motor_off(self, move_time):
|
||||
self.stepper.motor_enable(move_time, 0)
|
||||
|
@ -28,7 +30,7 @@ class PrinterExtruder:
|
|||
and not move.axes_d[0] and not move.axes_d[1]
|
||||
and not move.axes_d[2]):
|
||||
# Extrude only move - limit accel and velocity
|
||||
move.limit_speed(self.stepper.max_velocity, self.stepper.max_accel)
|
||||
move.limit_speed(self.max_e_velocity, self.max_e_accel)
|
||||
def move(self, move_time, move):
|
||||
if self.need_motor_enable:
|
||||
self.stepper.motor_enable(move_time, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue