This repository was archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbed_mesh.cfg
More file actions
140 lines (124 loc) · 6.17 KB
/
bed_mesh.cfg
File metadata and controls
140 lines (124 loc) · 6.17 KB
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
# Dragonfly3D with BIGTREETECH SKR mini E3 v2.0
######################################################
# Home
######################################################
[safe_z_home]
home_xy_position: 117.5,117.5 # 235/2=117.5
speed: 100
z_hop: 5
z_hop_speed: 15
######################################################
# CR-touch
######################################################
[bltouch]
sensor_pin: ^PC14
control_pin: PA1
x_offset: -46
y_offset: -8
z_offset: 0.7 # valores + menor altura nozzle # 6.25
pin_move_time: 0.4
pin_up_touch_mode_reports_triggered: False
######################################################
# Bed Mesh
######################################################
[bed_mesh]
speed: 120
horizontal_move_z: 3
mesh_min: 15,15 # x,y
mesh_max: 203,220 # x,y # Eje X = 32(para evitar chocar)-230=203 # Eje Y = 15-235=220
probe_count: 5,5 # Numero de probes para X,Y
algorithm: bicubic
################################################
# BED_MESH_CALIBRATE only in the print area
################################################
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
variable_parameter_AREA_START : 0,0
variable_parameter_AREA_END : 0,0
variable_mesh_area_offset : 10.0 # the clearance between print area and probe area
variable_probe_samples : 1 # number of sample per probe point
variable_min_probe_count : 4 # minimum probe count
variable_probe_count_scale_factor : 1 # scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
variable_enable_reference_index : False
gcode:
{% if params.AREA_START and params.AREA_END %}
{% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
{% set safe_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %}
{% set safe_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %}
{% set safe_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %}
{% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}
{% set area_min_x = params.AREA_START.split(",")[0]|float %}
{% set area_min_y = params.AREA_START.split(",")[1]|float %}
{% set area_max_x = params.AREA_END.split(",")[0]|float %}
{% set area_max_y = params.AREA_END.split(",")[1]|float %}
{% if bedMeshConfig.probe_count.split(",")|length == 2 %}
{% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
{% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %}
{% else %}
{% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
{% set meshPointY = bedMeshConfig.probe_count.split(",")[0]|int %}
{% endif %}
{% set meshMaxPointX = meshPointX %}
{% set meshMaxPointY = meshPointY %}
{% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
{% if area_min_x - mesh_area_offset >= safe_min_x %}
{% set area_min_x = area_min_x - mesh_area_offset %}
{% else %}
{% set area_min_x = safe_min_x %}
{% endif %}
{% if area_min_y - mesh_area_offset >= safe_min_y %}
{% set area_min_y = area_min_y - mesh_area_offset %}
{% else %}
{% set area_min_y = safe_min_y %}
{% endif %}
{% if area_max_x + mesh_area_offset <= safe_max_x %}
{% set area_max_x = area_max_x + mesh_area_offset %}
{% else %}
{% set area_max_x = safe_max_x %}
{% endif %}
{% if area_max_y + mesh_area_offset <= safe_max_y %}
{% set area_max_y = area_max_y + mesh_area_offset %}
{% else %}
{% set area_max_y = safe_max_y %}
{% endif %}
PRINT MSG="Set custom mesh area to ({area_min_x},{area_min_y}),({area_max_x},{area_max_y})" OUTPUT_TARGET=1
{% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x) * probe_count_scale_factor|float)|round(0)|int %}
{% if meshPointX < min_probe_count %}
{% set meshPointX = min_probe_count %}
{% endif %}
{% if meshPointX > meshMaxPointX %}
{% set meshPointX = meshMaxPointX %}
{% endif %}
{% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y) * probe_count_scale_factor|float)|round(0)|int %}
{% if meshPointY < min_probe_count %}
{% set meshPointY = min_probe_count %}
{% endif %}
{% if meshPointY > meshMaxPointY %}
{% set meshPointY = meshMaxPointY %}
{% endif %}
{% set algorithm = "bicubic" %}
{% if "algorithm" in bedMeshConfig %}
{% set algorithm = bedMeshConfig.algorithm %}
{% endif %}
{% if meshPointX >=7 or meshPointY >=7 %}
{% set algorithm = "bicubic" %}
{% endif %}
PRINT MSG="Use mesh algorithm : { algorithm }" OUTPUT_TARGET=1
PRINT MSG="Set custom mesh matrix to {meshPointX}x{meshPointY}" OUTPUT_TARGET=1
PRINT MSG="Mesh: {meshPointX}x{meshPointY}" OUTPUT_TARGET=2
{% if enable_reference_index %}
{% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={referenceIndex}
{% else %}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
{% endif %}
{% else %}
PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
PRINT MSG="Mesh: default" OUTPUT_TARGET=2
BED_MESH_CALIBRATE_BASE
{% endif %}
{% else %}
PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
PRINT MSG="Mesh: default" OUTPUT_TARGET=2
BED_MESH_CALIBRATE_BASE
{% endif %}