|
@@ -486,11 +486,6 @@ static uint8_t target_extruder;
|
486
|
486
|
delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND,
|
487
|
487
|
delta_clip_start_height = Z_MAX_POS;
|
488
|
488
|
|
489
|
|
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
490
|
|
- int delta_grid_spacing[2] = { 0, 0 };
|
491
|
|
- float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS];
|
492
|
|
- #endif
|
493
|
|
-
|
494
|
489
|
float delta_safe_distance_from_top();
|
495
|
490
|
void set_cartesian_from_steppers();
|
496
|
491
|
|
|
@@ -500,6 +495,11 @@ static uint8_t target_extruder;
|
500
|
495
|
|
501
|
496
|
#endif
|
502
|
497
|
|
|
498
|
+#if ENABLED(AUTO_BED_LEVELING_NONLINEAR)
|
|
499
|
+ int nonlinear_grid_spacing[2] = { 0 };
|
|
500
|
+ float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS];
|
|
501
|
+#endif
|
|
502
|
+
|
503
|
503
|
#if IS_SCARA
|
504
|
504
|
// Float constants for SCARA calculations
|
505
|
505
|
const float L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2,
|
|
@@ -3442,8 +3442,9 @@ inline void gcode_G28() {
|
3442
|
3442
|
yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
|
3443
|
3443
|
|
3444
|
3444
|
#if ENABLED(AUTO_BED_LEVELING_NONLINEAR)
|
3445
|
|
- delta_grid_spacing[X_AXIS] = xGridSpacing;
|
3446
|
|
- delta_grid_spacing[Y_AXIS] = yGridSpacing;
|
|
3445
|
+
|
|
3446
|
+ nonlinear_grid_spacing[X_AXIS] = xGridSpacing;
|
|
3447
|
+ nonlinear_grid_spacing[Y_AXIS] = yGridSpacing;
|
3447
|
3448
|
float zoffset = zprobe_zoffset;
|
3448
|
3449
|
if (code_seen('Z')) zoffset += code_value_axis_units(Z_AXIS);
|
3449
|
3450
|
|
|
@@ -7803,12 +7804,12 @@ void ok_to_send() {
|
7803
|
7804
|
|
7804
|
7805
|
// Adjust print surface height by linear interpolation over the bed_level array.
|
7805
|
7806
|
void adjust_delta(float cartesian[XYZ]) {
|
7806
|
|
- if (delta_grid_spacing[X_AXIS] == 0 || delta_grid_spacing[Y_AXIS] == 0) return; // G29 not done!
|
|
7807
|
+ if (nonlinear_grid_spacing[X_AXIS] == 0 || nonlinear_grid_spacing[Y_AXIS] == 0) return; // G29 not done!
|
7807
|
7808
|
|
7808
|
7809
|
int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2;
|
7809
|
7810
|
float h1 = 0.001 - half, h2 = half - 0.001,
|
7810
|
|
- grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / delta_grid_spacing[X_AXIS])),
|
7811
|
|
- grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / delta_grid_spacing[Y_AXIS]));
|
|
7811
|
+ grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / nonlinear_grid_spacing[X_AXIS])),
|
|
7812
|
+ grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / nonlinear_grid_spacing[Y_AXIS]));
|
7812
|
7813
|
int floor_x = floor(grid_x), floor_y = floor(grid_y);
|
7813
|
7814
|
float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y,
|
7814
|
7815
|
z1 = bed_level[floor_x + half][floor_y + half],
|