extruder_stepper: Support configuring pressure advance from config
Also added status report for extruder_stepper objects with the current pressure advance parameters values. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This commit is contained in:
parent
2e1b649617
commit
5d9ff75d02
|
@ -120,6 +120,13 @@ The following information is available in the
|
||||||
- `excluded_objects`: An array of strings listing the names of excluded objects.
|
- `excluded_objects`: An array of strings listing the names of excluded objects.
|
||||||
- `current_object`: The name of the object currently being printed.
|
- `current_object`: The name of the object currently being printed.
|
||||||
|
|
||||||
|
## extruder_stepper
|
||||||
|
|
||||||
|
The following information is available for extruder_stepper objects (as well as
|
||||||
|
[extruder](Config_Reference.md#extruder) objects):
|
||||||
|
- `pressure_advance`: The current [pressure advance](Pressure_Advance.md) value.
|
||||||
|
- `smooth_time`: The current pressure advance smooth time.
|
||||||
|
|
||||||
## fan
|
## fan
|
||||||
|
|
||||||
The following information is available in
|
The following information is available in
|
||||||
|
|
|
@ -15,6 +15,8 @@ class PrinterExtruderStepper:
|
||||||
self.handle_connect)
|
self.handle_connect)
|
||||||
def handle_connect(self):
|
def handle_connect(self):
|
||||||
self.extruder_stepper.sync_to_extruder(self.extruder_name)
|
self.extruder_stepper.sync_to_extruder(self.extruder_name)
|
||||||
|
def get_status(self, eventtime):
|
||||||
|
return self.extruder_stepper.get_status(eventtime)
|
||||||
|
|
||||||
def load_config_prefix(config):
|
def load_config_prefix(config):
|
||||||
return PrinterExtruderStepper(config)
|
return PrinterExtruderStepper(config)
|
||||||
|
|
|
@ -11,6 +11,9 @@ class ExtruderStepper:
|
||||||
self.printer = config.get_printer()
|
self.printer = config.get_printer()
|
||||||
self.name = config.get_name().split()[-1]
|
self.name = config.get_name().split()[-1]
|
||||||
self.pressure_advance = self.pressure_advance_smooth_time = 0.
|
self.pressure_advance = self.pressure_advance_smooth_time = 0.
|
||||||
|
self.config_pa = config.getfloat('pressure_advance', 0., minval=0.)
|
||||||
|
self.config_smooth_time = config.getfloat(
|
||||||
|
'pressure_advance_smooth_time', 0.040, above=0., maxval=.200)
|
||||||
# Setup stepper
|
# Setup stepper
|
||||||
self.stepper = stepper.PrinterStepper(config)
|
self.stepper = stepper.PrinterStepper(config)
|
||||||
ffi_main, ffi_lib = chelper.get_ffi()
|
ffi_main, ffi_lib = chelper.get_ffi()
|
||||||
|
@ -43,6 +46,7 @@ class ExtruderStepper:
|
||||||
def _handle_connect(self):
|
def _handle_connect(self):
|
||||||
toolhead = self.printer.lookup_object('toolhead')
|
toolhead = self.printer.lookup_object('toolhead')
|
||||||
toolhead.register_step_generator(self.stepper.generate_steps)
|
toolhead.register_step_generator(self.stepper.generate_steps)
|
||||||
|
self._set_pressure_advance(self.config_pa, self.config_smooth_time)
|
||||||
def get_status(self, eventtime):
|
def get_status(self, eventtime):
|
||||||
return {'pressure_advance': self.pressure_advance,
|
return {'pressure_advance': self.pressure_advance,
|
||||||
'smooth_time': self.pressure_advance_smooth_time}
|
'smooth_time': self.pressure_advance_smooth_time}
|
||||||
|
@ -192,10 +196,6 @@ class PrinterExtruder:
|
||||||
or config.get('rotation_distance', None) is not None):
|
or config.get('rotation_distance', None) is not None):
|
||||||
self.extruder_stepper = ExtruderStepper(config)
|
self.extruder_stepper = ExtruderStepper(config)
|
||||||
self.extruder_stepper.stepper.set_trapq(self.trapq)
|
self.extruder_stepper.stepper.set_trapq(self.trapq)
|
||||||
pa = config.getfloat('pressure_advance', 0., minval=0.)
|
|
||||||
smooth_time = config.getfloat('pressure_advance_smooth_time',
|
|
||||||
0.040, above=0., maxval=.200)
|
|
||||||
self.extruder_stepper._set_pressure_advance(pa, smooth_time)
|
|
||||||
# Register commands
|
# Register commands
|
||||||
gcode = self.printer.lookup_object('gcode')
|
gcode = self.printer.lookup_object('gcode')
|
||||||
if self.name == 'extruder':
|
if self.name == 'extruder':
|
||||||
|
|
Loading…
Reference in New Issue