diff --git a/Klipper_Files/Extra module/ercf.py b/Klipper_Files/Extra module/ercf.py index 9c3f6dbd..3456cde3 100644 --- a/Klipper_Files/Extra module/ercf.py +++ b/Klipper_Files/Extra module/ercf.py @@ -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 diff --git a/Klipper_Files/ercf_software.cfg b/Klipper_Files/ercf_software.cfg index 17531fc7..e75c3134 100644 --- a/Klipper_Files/ercf_software.cfg +++ b/Klipper_Files/ercf_software.cfg @@ -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} @@ -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 @@ -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}