|
10 | 10 | variable_calibrate_bed_mesh: True # True|False = enable bed meshing |
11 | 11 | variable_adaptive_mesh: True # True|False = enable adaptive bed meshing |
12 | 12 |
|
| 13 | +[gcode_macro _BED_MESH_SANITY_CHECK] |
| 14 | +gcode: |
| 15 | + {% set printable_x_max = printer["gcode_macro RatOS"].printable_x_max|float %} |
| 16 | + {% set printable_y_max = printer["gcode_macro RatOS"].printable_y_max|float %} |
| 17 | + {% set safe_home_x = printer["gcode_macro RatOS"].safe_home_x %} |
| 18 | + {% if safe_home_x is not defined or safe_home_x|lower == 'middle' %} |
| 19 | + {% set safe_home_x = printable_x_max / 2 %} |
| 20 | + {% endif %} |
| 21 | + {% set safe_home_y = printer["gcode_macro RatOS"].safe_home_y %} |
| 22 | + {% if safe_home_y is not defined or safe_home_y|lower == 'middle' %} |
| 23 | + {% set safe_home_y = printable_y_max / 2 %} |
| 24 | + {% endif %} |
| 25 | + {% set beacon_contact_start_print_true_zero = true if printer["gcode_macro RatOS"].beacon_contact_start_print_true_zero|default(false)|lower == 'true' else false %} |
| 26 | + |
| 27 | + {% if printer.configfile.settings.beacon is defined and beacon_contact_start_print_true_zero %} |
| 28 | + {% set zero_ref_pos = printer.configfile.settings.bed_mesh.zero_reference_position %} |
| 29 | + {% if zero_ref_pos is not defined or zero_ref_pos[0] != safe_home_x or zero_ref_pos[1] != safe_home_y %} |
| 30 | + CONSOLE_ECHO TYPE="error" TITLE="Zero reference position does not match safe home position" MSG="Please update your bed mesh zero reference position in printer.cfg, like so:_N__N_[bed_mesh]_N_zero_reference_position: {safe_home_x},{safe_home_y}_N_" |
| 31 | + _STOP_AND_RAISE_ERROR MSG="Zero reference position does not match safe home position" |
| 32 | + {% endif %} |
| 33 | + {% endif %} |
13 | 34 |
|
14 | 35 | [gcode_macro _START_PRINT_BED_MESH] |
15 | 36 | gcode: |
@@ -112,8 +133,8 @@ gcode: |
112 | 133 | {% else %} |
113 | 134 | BED_MESH_CALIBRATE PROFILE={default_profile} |
114 | 135 | {% endif %} |
| 136 | + _BEACON_APPLY_SCAN_COMPENSATION |
115 | 137 | {% endif %} |
116 | | - _BEACON_APPLY_SCAN_COMPENSATION |
117 | 138 | {% else %} |
118 | 139 | BED_MESH_CALIBRATE PROFILE={default_profile} |
119 | 140 | {% endif %} |
@@ -145,8 +166,8 @@ gcode: |
145 | 166 | {% else %} |
146 | 167 | BED_MESH_CALIBRATE PROFILE={default_profile} |
147 | 168 | {% endif %} |
| 169 | + _BEACON_APPLY_SCAN_COMPENSATION |
148 | 170 | {% endif %} |
149 | | - _BEACON_APPLY_SCAN_COMPENSATION |
150 | 171 | {% else %} |
151 | 172 | BED_MESH_CALIBRATE PROFILE={default_profile} |
152 | 173 | {% endif %} |
@@ -230,14 +251,14 @@ gcode: |
230 | 251 | BED_MESH_CALIBRATE PROBE_METHOD=contact USE_CONTACT_AREA=1 SAMPLES={beacon_contact_bed_mesh_samples} PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} RELATIVE_REFERENCE_INDEX=-1 |
231 | 252 | {% else %} |
232 | 253 | {% if beacon_scan_method_automatic %} |
233 | | - BED_MESH_CALIBRATE METHOD=automatic PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} RELATIVE_REFERENCE_INDEX=-1 |
| 254 | + BED_MESH_CALIBRATE METHOD=automatic PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} |
234 | 255 | {% else %} |
235 | | - BED_MESH_CALIBRATE PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} RELATIVE_REFERENCE_INDEX=-1 |
| 256 | + BED_MESH_CALIBRATE PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} |
236 | 257 | {% endif %} |
237 | 258 | {% endif %} |
238 | 259 | _BEACON_APPLY_SCAN_COMPENSATION |
239 | 260 | {% else %} |
240 | | - BED_MESH_CALIBRATE PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} RELATIVE_REFERENCE_INDEX=-1 |
| 261 | + BED_MESH_CALIBRATE PROFILE={default_profile} ALGORITHM={algorithm} MESH_MIN={mesh_x0},{mesh_y0} MESH_MAX={mesh_x1},{mesh_y1} PROBE_COUNT={mesh_count_x},{mesh_count_y} |
241 | 262 | {% endif %} |
242 | 263 |
|
243 | 264 | # probe for priming |
|
0 commit comments