VoronUsers/printer_mods/JD/RefillPlease/klipper/filament_runout_detection.cfg

57 lines
1.6 KiB
INI

#####################################################################
# RefillPlease - Filament Runout Sensor
#####################################################################
[filament_switch_sensor RunoutSensor]
switch_pin: !PG12 # Pin ESTOP4 for Octopus mcu
# Without M600 macro (uncomment the line below and comment the two lines in the "With Filament change M600 macro"
# pause_on_runout: true
# With M600 Filament change macro
pause_on_runout: false
runout_gcode: M600
#####################################################################
# Filament change macro M600
#####################################################################
[gcode_macro M600]
variable_park_x: 220
variable_park_y: 10
variable_z_lift: 20
variable_velocity: 60
variable_retract: 1
gcode:
SAVE_GCODE_STATE NAME=STATE_M600
# remembers the position
# fluidd annoyingly redefines this macro to retract and park the toolhead at the rear
PAUSE
# safe park coords
{% set th = printer.toolhead %}
{% set park_x = [params.X|default(park_x)|int, th.axis_maximum.x-2]|min %}
{% set park_y = [params.Y|default(park_y)|int, th.axis_maximum.y-10]|min %}
{% set park_z = [th.position.z + params.Z_LIFT|default(z_lift)|int, th.axis_maximum.z]|min %}
{% set park_feedrate = params.VELOCITY|default(velocity)|int * 60 %}
# retract at 50mm/sec
G91
G1 E-{retract} F3000
# park toolhead
G90
G0 X{park_x} Y{park_y} Z{park_z} F{park_feedrate}
# unload 60mm of filament
G91
G1 E-50 F3600
G1 E-10 F3600
# ask the waiter for a refill
M117 Refill please
RESTORE_GCODE_STATE NAME=STATE_M600