forked from zellneralex/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bed_mesh.cfg
133 lines (129 loc) · 6.42 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
#####################################################################
# 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
#
#####################################################################
[gcode_macro BED_MESH_CALIBRATE]
description: Perform QGL and bed mesh leveling
rename_existing: BED_MESH_CALIBRATE_BASE
gcode:
{% 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{user.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 %}