-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacro_basic.cfg
92 lines (82 loc) · 2.6 KB
/
macro_basic.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
####################################################################
# Basic Macros
####################################################################
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
[gcode_macro print_start]
gcode:
{% set bed_temp = params.BED_TEMP|default(50)|float %}
{% set bed_temp_preheat = params.BED_TEMP|float * 0.9 %}
{% set extruder_temp = params.EXTRUDER_TEMP|default(200)|float %}
{% if printer.heater_bed.temperature < bed_temp_preheat %}
M140 S{bed_temp_preheat} # set bed preheat temp
M190 S{bed_temp_preheat} # wait for bed. 95% of target temp
M140 S{bed_temp} # set target bed temp
{% else %}
M140 S{bed_temp} # set target bed temp
{% endif %}
{% if printer.extruder.temperature < extruder_temp %}
M104 S{extruder_temp} # set extruder temp
M109 S{extruder_temp} # wait for extruder
{% else %}
M104 S{extruder_temp} # set extruder temp
{% endif %}
G21 # metric values
G90 # absolute positioning
M107 # start with the fan off
G28 # move to endstops
G92 E0 # zero the extruded length
G1 F600 E5 # extrude 5mm of feed stock
G92 E0 # zero the extruded length again
led_white
SET_GCODE_OFFSET Z=.4 # flat pei site
[gcode_macro print_end]
gcode:
M400 # Free buffer
G91 # relative positioning
G1 E-1 F300 # retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+1 E-5 # move Z up a bit and retract filament even more
G90 # absolute positioning
M107 # fan off
G28 # move to endstop
M84 # steppers off
M104 S0 # hotend heater off
M140 S0 # bed heater off
led_breathing # lights idle
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
{% set X = params.X|default(0) %}
{% set Y = params.Y|default(0) %}
{% set Z = params.Z|default(280) %}
{% set E = params.E|default(5) %}
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{Z}
G90
G1 X{X} Y{Y} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
{% set E = params.E|default(5) %}
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
# TURN_OFF_HEATERS
G91
G1 E-5
M106 S0
G28
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
led_breathing