Browse Source

Float ABL mesh boundaries, no probe position rounding (#16018)

Jason Smith 5 years ago
parent
commit
752a1e76ab

+ 2
- 2
Marlin/src/feature/bedlevel/abl/abl.cpp View File

@@ -35,7 +35,7 @@
35 35
   #include "../../../lcd/extensible_ui/ui_api.h"
36 36
 #endif
37 37
 
38
-xy_int_t bilinear_grid_spacing, bilinear_start;
38
+xy_pos_t bilinear_grid_spacing, bilinear_start;
39 39
 xy_float_t bilinear_grid_factor;
40 40
 bed_mesh_t z_values;
41 41
 
@@ -153,7 +153,7 @@ void print_bilinear_leveling_grid() {
153 153
   #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2)
154 154
   #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2)
155 155
   float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y];
156
-  xy_int_t bilinear_grid_spacing_virt;
156
+  xy_pos_t bilinear_grid_spacing_virt;
157 157
   xy_float_t bilinear_grid_factor_virt;
158 158
 
159 159
   void print_bilinear_leveling_grid_virt() {

+ 1
- 1
Marlin/src/feature/bedlevel/abl/abl.h View File

@@ -23,7 +23,7 @@
23 23
 
24 24
 #include "../../../inc/MarlinConfigPre.h"
25 25
 
26
-extern xy_int_t bilinear_grid_spacing, bilinear_start;
26
+extern xy_pos_t bilinear_grid_spacing, bilinear_start;
27 27
 extern xy_float_t bilinear_grid_factor;
28 28
 extern bed_mesh_t z_values;
29 29
 float bilinear_z_offset(const xy_pos_t &raw);

+ 3
- 9
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

@@ -465,7 +465,7 @@ G29_TYPE GcodeSuite::G29() {
465 465
         reset_bed_level();
466 466
 
467 467
         // Initialize a grid with the given dimensions
468
-        bilinear_grid_spacing = gridSpacing.asInt();
468
+        bilinear_grid_spacing = gridSpacing;
469 469
         bilinear_start = probe_position_lf;
470 470
 
471 471
         // Can't re-enable (on error) until the new grid is written
@@ -583,10 +583,7 @@ G29_TYPE GcodeSuite::G29() {
583 583
 
584 584
         if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR;
585 585
 
586
-        const xy_pos_t base = probe_position_lf.asFloat() + gridSpacing * meshCount.asFloat();
587
-
588
-        probePos.set(FLOOR(base.x + (base.x < 0 ? 0 : 0.5)),
589
-                     FLOOR(base.y + (base.y < 0 ? 0 : 0.5)));
586
+        probePos = probe_position_lf + gridSpacing * meshCount.asFloat();
590 587
 
591 588
         #if ENABLED(AUTO_BED_LEVELING_LINEAR)
592 589
           indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index;
@@ -694,10 +691,7 @@ G29_TYPE GcodeSuite::G29() {
694 691
         // Inner loop is X with PROBE_Y_FIRST disabled
695 692
         for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {
696 693
 
697
-          const xy_pos_t base = probe_position_lf.asFloat() + gridSpacing * meshCount.asFloat();
698
-
699
-          probePos.set(FLOOR(base.x + (base.x < 0 ? 0 : 0.5)),
700
-                       FLOOR(base.y + (base.y < 0 ? 0 : 0.5)));
694
+          probePos = probe_position_lf + gridSpacing * meshCount.asFloat();
701 695
 
702 696
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
703 697
             indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0...

+ 4
- 4
Marlin/src/module/configuration_store.cpp View File

@@ -37,7 +37,7 @@
37 37
  */
38 38
 
39 39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V73"
40
+#define EEPROM_VERSION "V74"
41 41
 #define EEPROM_OFFSET 100
42 42
 
43 43
 // Check the integrity of data offsets.
@@ -192,7 +192,7 @@ typedef struct SettingsDataStruct {
192 192
   // AUTO_BED_LEVELING_BILINEAR
193 193
   //
194 194
   uint8_t grid_max_x, grid_max_y;                       // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y
195
-  xy_int_t bilinear_grid_spacing, bilinear_start;       // G29 L F
195
+  xy_pos_t bilinear_grid_spacing, bilinear_start;       // G29 L F
196 196
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
197 197
     bed_mesh_t z_values;                                // G29
198 198
   #else
@@ -658,7 +658,7 @@ void MarlinSettings::postprocess() {
658 658
       #else
659 659
         // For disabled Bilinear Grid write an empty 3x3 grid
660 660
         const uint8_t grid_max_x = 3, grid_max_y = 3;
661
-        const xy_int_t bilinear_start{0}, bilinear_grid_spacing{0};
661
+        const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0};
662 662
         dummy = 0;
663 663
         EEPROM_WRITE(grid_max_x);
664 664
         EEPROM_WRITE(grid_max_y);
@@ -1469,7 +1469,7 @@ void MarlinSettings::postprocess() {
1469 1469
         #endif // AUTO_BED_LEVELING_BILINEAR
1470 1470
           {
1471 1471
             // Skip past disabled (or stale) Bilinear Grid data
1472
-            xy_int_t bgs, bs;
1472
+            xy_pos_t bgs, bs;
1473 1473
             EEPROM_READ(bgs);
1474 1474
             EEPROM_READ(bs);
1475 1475
             for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy);

+ 0
- 1
Marlin/src/module/motion.h View File

@@ -359,7 +359,6 @@ void homeaxis(const AxisEnum axis);
359 359
 #if !HAS_BED_PROBE
360 360
   FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); }
361 361
 #endif
362
-FORCE_INLINE bool position_is_reachable_by_probe(const xy_int_t &pos) { return position_is_reachable_by_probe(pos.x, pos.y); }
363 362
 FORCE_INLINE bool position_is_reachable_by_probe(const xy_pos_t &pos) { return position_is_reachable_by_probe(pos.x, pos.y); }
364 363
 
365 364
 /**

Loading…
Cancel
Save