Skip to content

Commit

Permalink
bed_mesh: Force bicubic when lagrange would fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuh committed Dec 22, 2022
1 parent 473ffd8 commit d02ef65
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bed_mesh_fast.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,21 @@ gcode:
(safe_max_y - safe_min_y) * probe_count_scale )
| round(0) | int %}
{% set y_probes = ((y_probes, probe_min_count)|max, max_y_probes)|min %}
# Add probes for bicubic if one axis has too many probes for lagrange.
{% if x_probes > 6 and y_probes < 4 %}
{% set y_probes = 4 %}
{% elif y_probes > 6 and x_probes < 4 %}
{% set x_probes = 4 %}
{% endif %}
{% set probe_count = [x_probes,y_probes] %}
{% endif %}
{% set dummy = params.__setitem__("MESH_MIN", mesh_min_x~","~mesh_min_y) %}
{% set dummy = params.__setitem__("MESH_MAX", mesh_max_x~","~mesh_max_y) %}
{% set dummy = params.__setitem__("PROBE_COUNT", probe_count|join(',')) %}
# Force bicubic if we've exceeded the max for lagrange.
{% if probe_count[0]|int > 6 or probe_count[1]|default(0)|int > 6 %}
{% set dummy = params.__setitem__("ALGORITHM", "bicubic") %}
{% endif %}
{% endif %}
{% if printer["gcode_macro bed_mesh_calibrate"].km_override|default(False) %}
{% set calibrate_cmd = "_km_bed_mesh_calibrate_base" %}
Expand Down

0 comments on commit d02ef65

Please sign in to comment.