-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.cfg
101 lines (91 loc) · 3.15 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
##################################### TEST #############################################################
[pause_resume]
[display_status]
[gcode_macro LOAD_MESH_TEMP]
default_parameter_BED_TEMPERATURE: 0
default_parameter_FORCE: 0
gcode:
{action_respond_info("- AUTOMATED BED MESH GENERATOR -")}
{% if BED_TEMPERATURE|int < 30 %}
{action_respond_info("Your Bed temp ist to low, make sure it is at least 30 or higher")}
{% else %}
{% if printer.configfile.config["bed_mesh " + BED_TEMPERATURE] is defined and FORCE|int == 0 %}
BED_MESH_PROFILE LOAD={BED_TEMPERATURE}
G28 Z #because Z-Tilt #remove line if you ran G28 before starting this macro
{action_respond_info["Succesfully loaded bed_mesh " + BED_TEMPERATURE]}
{% else %}
{% if printer.configfile.config["bed_mesh " + BED_TEMPERATURE] is defined and FORCE|int == 1 %}
BED_MESH_PROFILE REMOVE={BED_TEMPERATURE}
{% endif %}
{action_respond_info("bed_mesh not defined, your bed Temperature will go up!")}
{action_respond_info("I will probe the Bed and save the mesh as bed_mesh " + BED_TEMPERATURE)}
ADD_BED_MESH TARGET_TEMP={BED_TEMPERATURE}
{% endif %}
{% endif %}
[gcode_macro ADD_BED_MESH]
default_parameter_TARGET_TEMP: 30
gcode:
M140 S{TARGET_TEMP} #Set bed target temperature
M190 S{TARGET_TEMP} #Wait for the bed to hit TARGET_TEMP
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE={TARGET_TEMP}
[gcode_macro PREHEATED_MESH]
variable_parameter_T_EXTRUDER: 0
variable_parameter_T_BED: 0
gcode:
M140 S{T_BED}
M190 S{T_BED}
G28
M109 S{T_EXTRUDER}
LOAD_MESH_TEMP BED_TEMPERATURE={T_BED}
G28
[gcode_macro G34]
gcode:
Z_TILT_ADJUST
[gcode_macro BL_Mesh]
gcode:
BED_MESH_CALIBRATE
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### end of definitions #####
G91
G1 E{E} F2100
RESTORE_GCODE_STATE NAME=PAUSE_state
BASE_RESUME