/
macros.cfg
122 lines (108 loc) · 4.11 KB
/
macros.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
#####################################################################
# Macros
#####################################################################
[gcode_macro G32]
gcode:
G28
Z_TILT_ADJUST
G28
[gcode_macro PRINT_START]
gcode:
# Set vars
{% set bed_temp = params.BED|default(100)|float %}
{% set extruder_temp = params.EXTRUDER|default(220)|float %}
{% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %}
_USER_VARIABLES2
{% set St = printer["gcode_macro _USER_VARIABLES2"].travel_speed * 60 %}
{% set max_x = printer.toolhead.axis_maximum.x|float %}
{% set max_y = printer.toolhead.axis_maximum.y|float %}
SET_GCODE_OFFSET Z=0 MOVE=1
SET_FAN_SPEED FAN=chamber_fan SPEED=1
CLEAR_PAUSE
BED_MESH_CLEAR ; clear mesh
G28
G90 ; Use absolute coordinates
G0 X{max_x|int / 2} Y{max_y|int / 3} Z20 F{St}
M117 Heating..
M140 S{bed_temp} ; Start bed heating
M190 S{bed_temp} ; Wait for bed to reach temperature
M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature
G32
M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature
CALIBRATE_Z
ADAPTIVE_BED_MESH SIZE={FL_SIZE}
INTRO_LINE
M117
#[gcode_macro PRINT_START]
#gcode:
# {% set bed_temp = params.BED|default(110)|float %}
# {% set extruder_temp = params.EXTRUDER|default(245)|float %}
# {% set retract = 10 %}
# SET_FAN_SPEED FAN=chamber_fan SPEED=1
# G28 ; home all axes
# G90
# M83
# G1 Z20 F3000 ; move nozzle away from bed
# M140 S{bed_temp} ; Start heating bed
# M190 S{bed_temp} ; Wait for bed to reach temperature
# M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature
# BED_MESH_CALIBRATE
# INTRO_LINE ; Prime the nozzle with an intro line
[gcode_macro INTRO_LINE]
gcode:
M117 Intro Line...
G90 ; Use absolute coordinates
M83
G92 E0
G1 X40 Y110 Z5 F6000 ; Move the nozzle to the front and near the bed
G1 Z0.7 F300 ; Move the nozzle very close to the bed
G1 E4 F900 ; extrude retract
G1 X80 E10.0 F500.0 ; intro line
G1 E-0.5 F1000
G92 E0.0 ; set extruder posion to 0
G1 X94 Z1 F6000 ; move away from intro line
M117
[gcode_macro PRINT_END]
description: Stop the print and filter the atmosphere for 10min before shuting down
gcode:
M400
PARK E=3
TURN_OFF_HEATERS
M107
BED_MESH_CLEAR
M84
[gcode_macro PARK]
description: Park the toolhead at the back and retract some filament if the nozzle is hot
gcode:
{% set E = params.E|default(1.7)|float %}
{% set x_park = printer.toolhead.axis_minimum.x|float + 60.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 10.0 %}
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set St = printer["gcode_macro _USER_VARIABLES2"].travel_speed * 60 %}
{% set Sz = printer["gcode_macro _USER_VARIABLES2"].z_drop_speed * 60 %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 50.0) %}
{% set z_safe = 50.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
{% if printer.extruder.temperature > 185 %}
G1 E-{E} F300
{% endif %}
G91
G1 Z{z_safe} F{Sz}
G90
G0 X{x_park} Y{y_park} F{St}
G91
[gcode_macro LOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E30 F300 ; load
G1 E15 F150 ; prime nozzle with filament
M82 ; set extruder to absolute
[gcode_macro UNLOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E10 F300 ; extrude a little to soften tip
G1 E-40 F1800 ; retract some, but not too much or it will jam
M82 ; set extruder to absolute