-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
fd-macros-example.cfg
181 lines (147 loc) · 4.77 KB
/
fd-macros-example.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Copyright (C) 2023 Frank Roth <developer@freakydude.de>
# Example configuration to support
# basic features needed for BigTreeTech-TouchscreenFirmware (https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware)
# in combination with Mainsail frontend
[gcode_macro RUN_IDLE_TIMEOUT]
description: Starts if idle timeout has expired
triggered by klipper
gcode:
_FD_RUN_IDLE_TIMEOUT {rawparams}
[gcode_macro SET_PAUSE_NEXT_LAYER]
description: Enable a pause if the next layer is reached
triggered by mainsail
gcode:
_FD_SET_PAUSE_NEXT_LAYER {rawparams}
[gcode_macro SET_PAUSE_AT_LAYER]
description: Enable a pause at a specified layer
triggered by mainsail
gcode:
_FD_SET_PAUSE_AT_LAYER {rawparams}
[gcode_macro SET_PRINT_STATS_INFO]
description: Enables mainsail and display features
triggered by slicer
rename_existing: SET_PRINT_STATS_INFO_BASE
gcode:
{% set CURRENT_LAYER = params.CURRENT_LAYER | default(0) | int %}
_FD_SET_PRINT_STATS_INFO {rawparams}
SET_PRINT_STATS_INFO_BASE {rawparams}
{% if printer['gcode_macro _FD_SET_PAUSE_NEXT_LAYER'].enabled == 1 %}
PAUSE
SET_GCODE_VARIABLE MACRO=_FD_SET_PAUSE_NEXT_LAYER VARIABLE=enabled VALUE="0"
{% elif printer['gcode_macro _FD_SET_PAUSE_AT_LAYER'].enabled == 1 and printer['gcode_macro _FD_SET_PAUSE_AT_LAYER'].layer == CURRENT_LAYER %}
PAUSE
SET_GCODE_VARIABLE MACRO=_FD_SET_PAUSE_AT_LAYER VARIABLE=enabled VALUE="0"
{% endif %}
[gcode_macro G28]
rename_existing: G28.1
gcode:
_FD_SET_STATUSLED STATE="home"
G28.1 {rawparams}
_FD_SET_STATUSLED STATE="ready"
[gcode_macro M600]
description: Filament change, marlin alias to pause
triggered by slicer or display
gcode:
PAUSE
_FD_SET_STATUSLED STATE="change"
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
gcode:
_FD_SET_STATUSLED STATE="level"
BED_MESH_CALIBRATE_BASE {rawparams}
_FD_SET_STATUSLED STATE="ready"
[gcode_macro PAUSE]
description: Pause the current running print
triggered by mainsail
rename_existing: PAUSE_BASE
gcode:
_FD_SET_STATUSLED STATE="pause"
PAUSE_BASE {rawparams}
_FD_PAUSE
[gcode_macro RESUME]
description: Resume the current running print
triggered by mainsail
rename_existing: RESUME_BASE
gcode:
_FD_SET_STATUSLED STATE="heat"
_FD_RESUME
_FD_SET_STATUSLED STATE="print"
RESUME_BASE {rawparams}
[gcode_macro CANCEL_PRINT]
description: Cancel the current running print
triggered by mainsail
rename_existing: CANCEL_PRINT_BASE
gcode:
_FD_CANCEL_PRINT
_FD_SET_STATUSLED STATE="ready"
CANCEL_PRINT_BASE {rawparams}
[gcode_macro START_PRINT]
description: Startcode to prepare a new printing
triggered by slicer
gcode:
_FD_SET_STATUSLED STATE="ready"
_FD_START_PRINT
#Get Bed and Extruder temperature from Slicer GCode
{% set BED_TEMP = params.BED_TEMP | default(60) | float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP | default(200) | float %}
{% set MIN_X = printer.toolhead.axis_minimum.x | default(0) | float %}
{% set MIN_Y = printer.toolhead.axis_minimum.y | default(0) | float %}
M117 Heat Nozzle ({EXTRUDER_TEMP}°C) and Bed ({BED_TEMP}°C)
_FD_SET_STATUSLED STATE="heat"
M190 S{BED_TEMP}
M104 S{EXTRUDER_TEMP}
_FD_SET_STATUSLED STATE="home"
# Init
M83 # relative extrusion mode
G90 # use absolute coordinates
G92 E0 # reset extruder
# Home
{% if 'xy' in printer.toolhead.homed_axes %}
G28 Z
{% else %}
G28
{% endif %}
G0 X{MIN_X} Y{MIN_Y} Z15 F{50 * 60}
# Use the default bed mesh
BED_MESH_PROFILE LOAD=default
_FD_SET_STATUSLED STATE="heat"
M109 S{EXTRUDER_TEMP}
_FD_SET_STATUSLED STATE="prime"
_FD_PRIME_LINE
_FD_SET_STATUSLED STATE="print"
M117 Printing
G92 E0 # reset extruder
[gcode_macro END_PRINT]
description: Endcode to finalize made printing
triggered by slicer
gcode:
M117 Print finished
_FD_END_PRINT
_FD_SET_STATUSLED STATE="ready"
[gcode_macro _PROBE_DEPLOY]
description: The command to deploy your touch probe
triggered by display
gcode:
{% if printer.configfile.settings.bltouch is defined %}
BLTOUCH_DEBUG COMMAND=pin_down
{% elif printer["output_pin _probe_enable"] is defined %}
SET_PIN PIN=_probe_enable VALUE=1
{% endif %}
[gcode_macro _PROBE_STOW]
description: The command to stow your touch probe
triggered by display
gcode:
{% if printer.configfile.settings.bltouch is defined %}
BLTOUCH_DEBUG COMMAND=pin_up
{% elif printer["output_pin _probe_enable"] is defined %}
SET_PIN PIN=_probe_enable VALUE=0
{% endif %}
[gcode_macro _PROBE_RESET]
description: The command to reset your touch probe
triggered by display
gcode:
{% if printer.configfile.settings.bltouch is defined %}
BLTOUCH_DEBUG COMMAND=reset
{% elif printer["output_pin _probe_enable"] is defined %}
SET_PIN PIN=_probe_enable VALUE=0
{% endif %}