Skip to content

Commit

Permalink
Merge pull request #102 from cmroche/retry_extract
Browse files Browse the repository at this point in the history
Fixes for _ERCF_UNLOAD_TOOL process
  • Loading branch information
EtteGit authored Jun 17, 2022
2 parents 940347f + 52030d0 commit ae07366
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Klipper_Files/Extra module/ercf.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ def cmd_ERCF_UNLOAD(self, gcmd):
req_length = gcmd.get_float('LENGTH', 1200.)
num_moves = gcmd.get_int('MOVES', 1)
self.toolhead.wait_moves()
# Do not unload if filament is still in the toolhead
sensor = self.printer.lookup_object(
"filament_switch_sensor toolhead_sensor")
if bool(sensor.runout_helper.filament_present):
self.gcode.respond_info(
"Unable to unload filament while still in extruder")
return
# i.e. long move that will be fast and iterated using the encoder
if req_length > self.LONG_MOVE_THRESHOLD:
req_length = req_length - buffer_length
Expand Down
5 changes: 5 additions & 0 deletions Klipper_Files/ercf_software.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ gcode:
{% set ercf_params = printer.save_variables.variables %}
ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|string)]}
G4 P100
M400
_ERCF_EXTRACT_FROM_EXTRUDER
{% set ercf_params = printer.save_variables.variables %}
ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float + printer["gcode_macro _ERCF_VAR"].unload_modifier|float - 60.0}
Expand All @@ -468,9 +469,12 @@ description: Extract the tip at the parking position from the extruder
gcode:
{% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %}
M118 Filament still below the extruder... Trying extraction again...
_ERCF_SERVO_UP
G1 E-5.00 F1200.0
G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float + 25.0} F2000
_ERCF_SERVO_DOWN
G4 P100
M400
_ERCF_RETRY_EXTRACT_FROM_EXTRUDER
{% else %}
G91
Expand Down Expand Up @@ -571,6 +575,7 @@ gcode:
MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0
G1 E{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0
G4 P100
M400
ERCF_HOME_EXTRUDER TOTAL_LENGTH=30.0 STEP_LENGTH=0.5
_ERCF_UNSELECT_TOOL FORCED=0
ERCF_FINALIZE_LOAD LENGTH={printer["gcode_macro _ERCF_VAR"].sensor_to_nozzle|float} THRESHOLD={printer["gcode_macro _ERCF_VAR"].final_load_check_threshold|float} TUNE={tune}
Expand Down

0 comments on commit ae07366

Please sign in to comment.