forked from zellneralex/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbed_mesh.cfg
173 lines (169 loc) · 7.67 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
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
#####################################################################
# Bed Mesh Definition
#####################################################################
[bed_mesh]
## Start end end point of mesh
mesh_min: 30,30
mesh_max: 320,320
speed: 1000
## The height (in mm) that the head should be commanded to move to
## just prior to starting a probe operation. The default is 5.
horizontal_move_z: 7.5 ; MagProbe Klicky
#horizontal_move_z: 4 ; Vinda or Omron
probe_count: 9,9
## The interpolation algorithm to use. May be either "lagrange"
## or "bicubic". This option will not affect 3x3 grids, which
## are forced to use lagrange sampling. Default is lagrange.
algorithm: bicubic
##[(7x7)-1] / 2 = 24
##[(5x5)-1] / 2 = 12
relative_reference_index: 40
## The gcode z position in which to start phasing out z-adjustment
## when fade is enabled. Default is 1.0.
#fade_start: 1
## The gcode z position in which phasing out completes. When set
## to a value below fade_start, fade is disabled. It should be
## noted that fade may add unwanted scaling along the z-axis of a
## print. If a user wishes to enable fade, a value of 10.0 is
## recommended. Default is 0.0, which disables fade.
#fade_end: 10
## The z position in which fade should converge. When this value is set
## to a non-zero value it must be within the range of z-values in the mesh.
## Users that wish to converge to the z homing position should set this to 0.
## Default is the average z value of the mesh.
#fade_target: 0
## The distance (in mm) along a move to check for split_delta_z.
## This is also the minimum length that a move can be split. Default
## is 5.0.
move_check_distance: 3
## The amount of Z difference (in mm) along a move that will
## trigger a split. Default is .025.
split_delta_z: 0.0125
## A comma separated pair of integers (X,Y) defining the number of
## points per segment to interpolate in the mesh along each axis. A
## "segment" can be defined as the space between each probed
## point. The user may enter a single value which will be applied
## to both axes. Default is 2,2.
mesh_pps: 2,2
## When using the bicubic algorithm the tension parameter above
## may be applied to change the amount of slope interpolated.
## Larger numbers will increase the amount of slope, which
## results in more curvature in the mesh. Default is .2.
#bicubic_tension: 0.2
#####################################################################
# 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
#
#####################################################################
## customize BED MESH CALIBRATE gcode
[gcode_macro BED_MESH_CALIBRATE]
description: Perform QGL and bed mesh leveling
rename_existing: BED_MESH_CALIBRATE_BASE
gcode:
##### get hardware enables #####
{% set ena_mag_probe = printer['gcode_macro _USER_VARIABLE'].mag_probe|lower %}
##### get params and prepare to send them to the base macro #####
{% set get_params = [] %}
{% for key in params %}
{% set get_params = get_params.append(key + "=" + params[key]) %}
{% endfor %}
##### end of definitions #####
_CG28
BED_MESH_CLEAR
## check if QGL was already executed
{% if printer.quad_gantry_level.applied|lower == 'false' %}
QUAD_GANTRY_LEVEL PARK=false
{% endif %}
{% if ena_mag_probe == 'true' %} ATTACH_PROBE {% endif %}
BED_MESH_CALIBRATE_BASE {get_params|join(" ")}
{% if ena_mag_probe == 'true' %} DETACH_PROBE {% endif %}
## use BED_MESH_STORE -> generate MESH and save immediately and park in the middle
## use BED_MESH_STORE PARK=false -> generate MESH and save immediately
## use BED_MESH_STORE SAVE=false -> generate MESH and save it later
## use BED_MESH_STORE SAVE=false PARK=false -> would be most likely be used in your macros
[gcode_macro BED_MESH_STORE]
description: Generate a mesh, name it and run save_config if requested
variable_save_at_end: 'false'
gcode:
##### set default parameter value #####
{% set save = params.SAVE|default('true') %}
{% set park = params.PARK|default('true') %}
############# Get user defines #############
{% set center_x = printer["gcode_macro _USER_VARIABLE"].center_x %}
{% set center_y = printer["gcode_macro _USER_VARIABLE"].center_y %}
{% set z_min_delta = printer["gcode_macro _USER_VARIABLE"].z_min_delta %}
{% set z_hop = printer["gcode_macro _USER_VARIABLE"].z_hop %}
{% set bed_temp = printer.heater_bed.target|int %}
##### define plate name: Voron (default) or flexplate name #####
{% set plate_name = 'Voron' %}
{% if 'save_variables' in printer.configfile.config %}
{% if printer.save_variables.variables.plate_array is defined %}
{% set plate_index = printer.save_variables.variables.plate_index|int %}
{% set plate_name = printer.save_variables.variables.plate_array[plate_index][0] %}
{% endif %}
{% endif %}
##### join everything to a single mesh name #####
{% set mesh_name = plate_name + "-Bed_Temp-" + bed_temp|string + "C" %}
##### end of definitions #####
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE={mesh_name}
BED_MESH_PROFILE REMOVE=default
{% if park|lower == 'true' %}
G90 ; set absolute
G0 Z{z_min_delta} F1800 ; move nozzle to z high first
G0 X{center_x} Y{center_x} F18000 ; home to get toolhead in the middle
{% endif %}
{% if save|lower == 'true' %}
_PRINT_AR T="BED_MESH: Save Config!"
SAVE_CONFIG
{% else %}
_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 default parameter value #####
{% set auto = params.AUTO|default('false') %}
{% set bed_temp = printer.heater_bed.target|int %}
##### define plate name: Voron (default) or flexplate name #####
{% set plate_name = 'Voron' %}
{% if 'save_variables' in printer.configfile.config %}
{% if printer.save_variables.variables.plate_array is defined %}
{% set plate_index = printer.save_variables.variables.plate_index|int %}
{% set plate_name = printer.save_variables.variables.plate_array[plate_index][0] %}
{% endif %}
{% endif %}
##### join everything to a single mesh name #####
{% set mesh_name = plate_name + "-Bed_Temp-" + bed_temp|string + "C" %}
##### end of definitions #####
{% if printer.configfile.config["bed_mesh " + mesh_name] is defined %}
BED_MESH_CLEAR
BED_MESH_PROFILE LOAD={mesh_name}
_PRINT_AR T="{"BED_MESH: " + mesh_name + " loaded"}"
{% else %}
{% if auto|lower == 'true' %}
_PRINT_AR T="{"BED_MESH: " + mesh_name + " needs to be generated"}"
BED_MESH_STORE SAVE=false PARK=false
{% else %}
_PRINT_AR T="{"BED_MESH ERROR: " + mesh_name + " not defined"}"
{% endif %}
{% 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 == 'true' %}
_PRINT_AR T="BED_MESH: Save Config!"
SAVE_CONFIG
{% endif %}