|
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: |
@@ -206,9 +227,9 @@ gcode: |
206 | 227 | # mesh |
207 | 228 | RATOS_ECHO PREFIX="Adaptive Mesh" MSG="mesh coordinates X0={mesh_x0} Y0={mesh_y0} X1={mesh_x1} Y1={mesh_y1}" |
208 | 229 | {% if printer.configfile.settings.beacon is defined and beacon_contact_bed_mesh %} |
209 | | - 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 |
| 230 | + 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} |
210 | 231 | {% else %} |
211 | | - 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 |
| 232 | + 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} |
212 | 233 | {% if printer.configfile.settings.beacon is defined %} |
213 | 234 | _BEACON_APPLY_SCAN_COMPENSATION |
214 | 235 | {% endif %} |
|
0 commit comments