-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunout.cfg
83 lines (73 loc) · 2.61 KB
/
runout.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[filament_switch_sensor runout]
pause_on_runout: False
runout_gcode:
#SET_FILAMENT_SENSOR SENSOR=runout ENABLE=1
{action_respond_info("RUNOUT: Filament runout")}
BEEP I=10 DUR=100
PAUSE
insert_gcode:
{action_respond_info("RUNOUT: Filament inserted")}
switch_pin: !PC1
event_delay: 30
#####################################################################
# Macro
#####################################################################
# [gcode_macro SET_FILAMENT_SENSOR]
# description: Sets the filament sensor on/off and save value to file
# rename_existing: SET_FILAMENT_SENSOR_BASE
# gcode:
# {% if printer.save_variables.variables.filament_sensor is not defined %}
# {% set filament_sensor = {params.SENSOR|string: params.ENABLE|int} %}
# {% else %}
# {% set filament_sensor = printer.save_variables.variables.filament_sensor %}
# {% set _dummy = filament_sensor.update({params.SENSOR|string: params.ENABLE|int}) %}
# {% endif %}
# SET_FILAMENT_SENSOR_BASE SENSOR={params.SENSOR} ENABLE={params.ENABLE}
# SAVE_VARIABLE VARIABLE=filament_sensor VALUE="{filament_sensor}"
#
# [gcode_macro _RESTORE_FILAMENT_SENSOR]
# description: Restore the filament sensor on/off state at klipper start
# gcode:
# {% if printer.save_variables.variables.filament_sensor is defined %}
# {% for sensor in printer.save_variables.variables.filament_sensor %}
# SET_FILAMENT_SENSOR_BASE SENSOR={sensor} ENABLE={printer.save_variables.variables.filament_sensor[sensor]}
# {% endfor %}
# {% endif %}
[gcode_macro M8029]
gcode:
{% if params.D is defined %}
{% if (params.D|int)==1 %}
SET_FILAMENT_SENSOR SENSOR=runout ENABLE=1
{% endif %}
{% if (params.D|int)==0 %}
SET_FILAMENT_SENSOR SENSOR=runout ENABLE=0
{% endif %}
{% endif %}
######################################################################
# Filament Change
######################################################################
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.
[gcode_macro M600]
description: Filament change
gcode:
#SAVE_GCODE_STATE NAME=M600_state
PAUSE
M603
[gcode_macro M603]
description: filament unload
gcode:
{% if printer['pause_resume'].is_paused | int == 1 %}
M83 #relative extrude
G1 E-80 F600
{% endif %}
[gcode_macro M604]
description: filament lode
gcode:
{% if printer['pause_resume'].is_paused | int == 1 %}
M83 #relative extrude
G1 E100 F600
{% endif %}