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

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

23
 
23
 
24
 #include "../../../inc/MarlinConfigPre.h"
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
 extern xy_float_t bilinear_grid_factor;
27
 extern xy_float_t bilinear_grid_factor;
28
 extern bed_mesh_t z_values;
28
 extern bed_mesh_t z_values;
29
 float bilinear_z_offset(const xy_pos_t &raw);
29
 float bilinear_z_offset(const xy_pos_t &raw);

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

465
         reset_bed_level();
465
         reset_bed_level();
466
 
466
 
467
         // Initialize a grid with the given dimensions
467
         // Initialize a grid with the given dimensions
468
-        bilinear_grid_spacing = gridSpacing.asInt();
468
+        bilinear_grid_spacing = gridSpacing;
469
         bilinear_start = probe_position_lf;
469
         bilinear_start = probe_position_lf;
470
 
470
 
471
         // Can't re-enable (on error) until the new grid is written
471
         // Can't re-enable (on error) until the new grid is written
583
 
583
 
584
         if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR;
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
         #if ENABLED(AUTO_BED_LEVELING_LINEAR)
588
         #if ENABLED(AUTO_BED_LEVELING_LINEAR)
592
           indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index;
589
           indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index;
694
         // Inner loop is X with PROBE_Y_FIRST disabled
691
         // Inner loop is X with PROBE_Y_FIRST disabled
695
         for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {
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
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
696
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
703
             indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0...
697
             indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0...

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

37
  */
37
  */
38
 
38
 
39
 // Change EEPROM version if the structure changes
39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V73"
40
+#define EEPROM_VERSION "V74"
41
 #define EEPROM_OFFSET 100
41
 #define EEPROM_OFFSET 100
42
 
42
 
43
 // Check the integrity of data offsets.
43
 // Check the integrity of data offsets.
192
   // AUTO_BED_LEVELING_BILINEAR
192
   // AUTO_BED_LEVELING_BILINEAR
193
   //
193
   //
194
   uint8_t grid_max_x, grid_max_y;                       // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y
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
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
196
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
197
     bed_mesh_t z_values;                                // G29
197
     bed_mesh_t z_values;                                // G29
198
   #else
198
   #else
658
       #else
658
       #else
659
         // For disabled Bilinear Grid write an empty 3x3 grid
659
         // For disabled Bilinear Grid write an empty 3x3 grid
660
         const uint8_t grid_max_x = 3, grid_max_y = 3;
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
         dummy = 0;
662
         dummy = 0;
663
         EEPROM_WRITE(grid_max_x);
663
         EEPROM_WRITE(grid_max_x);
664
         EEPROM_WRITE(grid_max_y);
664
         EEPROM_WRITE(grid_max_y);
1469
         #endif // AUTO_BED_LEVELING_BILINEAR
1469
         #endif // AUTO_BED_LEVELING_BILINEAR
1470
           {
1470
           {
1471
             // Skip past disabled (or stale) Bilinear Grid data
1471
             // Skip past disabled (or stale) Bilinear Grid data
1472
-            xy_int_t bgs, bs;
1472
+            xy_pos_t bgs, bs;
1473
             EEPROM_READ(bgs);
1473
             EEPROM_READ(bgs);
1474
             EEPROM_READ(bs);
1474
             EEPROM_READ(bs);
1475
             for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy);
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
 #if !HAS_BED_PROBE
359
 #if !HAS_BED_PROBE
360
   FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); }
360
   FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); }
361
 #endif
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
 FORCE_INLINE bool position_is_reachable_by_probe(const xy_pos_t &pos) { return position_is_reachable_by_probe(pos.x, pos.y); }
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