Skip to content

Commit d02ef65

Browse files
committed
bed_mesh: Force bicubic when lagrange would fail
1 parent 473ffd8 commit d02ef65

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bed_mesh_fast.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,21 @@ gcode:
5555
(safe_max_y - safe_min_y) * probe_count_scale )
5656
| round(0) | int %}
5757
{% set y_probes = ((y_probes, probe_min_count)|max, max_y_probes)|min %}
58+
# Add probes for bicubic if one axis has too many probes for lagrange.
59+
{% if x_probes > 6 and y_probes < 4 %}
60+
{% set y_probes = 4 %}
61+
{% elif y_probes > 6 and x_probes < 4 %}
62+
{% set x_probes = 4 %}
63+
{% endif %}
5864
{% set probe_count = [x_probes,y_probes] %}
5965
{% endif %}
6066
{% set dummy = params.__setitem__("MESH_MIN", mesh_min_x~","~mesh_min_y) %}
6167
{% set dummy = params.__setitem__("MESH_MAX", mesh_max_x~","~mesh_max_y) %}
6268
{% set dummy = params.__setitem__("PROBE_COUNT", probe_count|join(',')) %}
69+
# Force bicubic if we've exceeded the max for lagrange.
70+
{% if probe_count[0]|int > 6 or probe_count[1]|default(0)|int > 6 %}
71+
{% set dummy = params.__setitem__("ALGORITHM", "bicubic") %}
72+
{% endif %}
6373
{% endif %}
6474
{% if printer["gcode_macro bed_mesh_calibrate"].km_override|default(False) %}
6575
{% set calibrate_cmd = "_km_bed_mesh_calibrate_base" %}

0 commit comments

Comments
 (0)