forked from wile-e1/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbed_mesh.cfg
102 lines (98 loc) · 4.54 KB
/
bed_mesh.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
#####################################################################
# Bed Mesh Definition
#####################################################################
[bed_mesh]
speed: 300
#horizontal_move_z: 15#12#9
horizontal_move_z: 13
# mesh_min: 50,25
# mesh_max: 250, 250
mesh_min: 30,20
mesh_max: 270,270
probe_count: 7,7
mesh_pps: 3,3
algorithm: bicubic
bicubic_tension: 0.3
move_check_distance: 5
split_delta_z: .025
fade_start: .6
fade_end: 4
relative_reference_index: 24
#####################################################################
# Macros
#####################################################################
#
# Warning: If you use the flexplate names insight your stored mesh's than:
# - insure that it does not contain spaces
# - insure that it does not contain special charakters
# - insure that it does not contain german "umlaut" (äöü and ß)
#
# All macros are writen in the way that they will work without a [save_variables]
# block and also without the flexplate.cfg
#
#####################################################################
[gcode_macro BED_MESH_CALIBRATE]
description: Perform QGL and bed mesh leveling
rename_existing: BED_MESH_CALIBRATE_BASE
gcode:
status_meshing
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% if "xyz" not in printer.toolhead.homed_axes %} G28 {% endif %}
BED_MESH_CLEAR
{% if not printer.quad_gantry_level.applied %} QUAD_GANTRY_LEVEL PARK=false {% endif %}
{% if user.hw.mag_probe.ena %} ATTACH_PROBE {% endif %}
BED_MESH_CALIBRATE_BASE {rawparams}
{% if user.hw.mag_probe.ena %} DETACH_PROBE {% endif %}
## use BED_MESH_STORE -> generate MESH and park in the middle
## use BED_MESH_STORE SAVE=now -> generate MESH and park in the middle and save immediately
## use BED_MESH_STORE PARK=false -> generate MESH
## use BED_MESH_STORE SAVE=later -> generate MESH and park in the middle and save it later
[gcode_macro BED_MESH_STORE]
description: Generate a mesh, name it and run save_config if requested
variable_save_at_end: False
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% set name = '' if printer.save_variables.variables.plates is not defined
else printer.save_variables.variables.plates.array[printer.save_variables.variables.plates.index].name + '-' %}
{% set mesh_name = name + "Bed_Temp-" + printer.heater_bed.target|int|string + "C" %}
{action_respond_info("BED_MESH: Generate \"%s\"" % mesh_name)}
BED_MESH_CALIBRATE PROFILE={mesh_name}
{% if params.PARK|default('true')|lower == 'true' %}
G90 # set absolute
G0 Z{user.park.bed.z} F{user.speed.z_hop} # lift first
G0 X{use.park.bed.x} Y{user.park.bed.y} F{user.speed.travel} # park toolhead
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} # set it back to relative
{% endif %}
{% if params.SAVE|default('none')|lower == 'now' %}
_PRINT_AR T="BED_MESH: Save Config!"
SAVE_CONFIG
{% elif params.SAVE|default('none')|lower == 'later' %}
_PRINT_AR T="BED_MESH: Save Config after print done"
SET_GCODE_VARIABLE MACRO=BED_MESH_STORE VARIABLE=save_at_end VALUE=True
{% endif %}
## use BED_MESH_LOAD -> load an existing MESH
## use BED_MESH_LOAD AUTO=true -> load an existing MESH or generate a new one and prepare it to be saved after print end
[gcode_macro BED_MESH_LOAD]
description: Load an existing mesh or generate a new one
gcode:
{% set name = '' if printer.save_variables.variables.plates is not defined
else printer.save_variables.variables.plates.array[printer.save_variables.variables.plates.index].name + '-' %}
{% set mesh_name = name + "Bed_Temp-" + printer.heater_bed.target|int|string + "C" %}
{% if printer.configfile.config["bed_mesh " + mesh_name] is defined %}
{action_respond_info("BED_MESH: \"%s\" loaded" % mesh_name)}
BED_MESH_CLEAR
BED_MESH_PROFILE LOAD={mesh_name}
{% elif params.AUTO|default('false')|lower == 'true' %}
{action_respond_info("BED_MESH: \"%s\" needs to be generated" % mesh_name)}
BED_MESH_STORE SAVE=none PARK=false
{% else %}
{action_respond_info("BED_MESH: ERROR \"%s\" not defined" % mesh_name)}
{% endif %}
## add this to your PRINT_END to save a mesh if needed 10 seconds after print ended
## UPDATE_DELAYED_GCODE ID=_BED_MESH_SAVE DURATION=10
[delayed_gcode _BED_MESH_SAVE]
gcode:
{% if printer["gcode_macro MESH_STORE"].save_at_end %}
{action_respond_info("BED_MESH: Save Config!")}
SAVE_CONFIG
{% endif %}