Browse Source

Make probed points more symmetrical

Scott Lahteine 8 years ago
parent
commit
55355a4fb8
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      Marlin/Marlin_main.cpp

+ 6
- 4
Marlin/Marlin_main.cpp View File

@@ -3609,8 +3609,8 @@ inline void gcode_G28() {
3609 3609
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3610 3610
 
3611 3611
       // probe at the points of a lattice grid
3612
-      const int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points - 1),
3613
-                yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
3612
+      const float xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points - 1),
3613
+                  yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
3614 3614
 
3615 3615
       #if ENABLED(DELTA)
3616 3616
         delta_grid_spacing[X_AXIS] = xGridSpacing;
@@ -3639,7 +3639,8 @@ inline void gcode_G28() {
3639 3639
       bool zig = (auto_bed_leveling_grid_points & 1) ? true : false; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
3640 3640
 
3641 3641
       for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
3642
-        double yProbe = front_probe_bed_position + yGridSpacing * yCount;
3642
+        float yBase = front_probe_bed_position + yGridSpacing * yCount,
3643
+              yProbe = floor(yProbe + (yProbe < 0 ? 0 : 0.5));
3643 3644
         int xStart, xStop, xInc;
3644 3645
 
3645 3646
         if (zig) {
@@ -3656,7 +3657,8 @@ inline void gcode_G28() {
3656 3657
         zig = !zig;
3657 3658
 
3658 3659
         for (int xCount = xStart; xCount != xStop; xCount += xInc) {
3659
-          double xProbe = left_probe_bed_position + xGridSpacing * xCount;
3660
+          float xBase = left_probe_bed_position + xGridSpacing * xCount,
3661
+                xProbe = floor(xProbe + (xProbe < 0 ? 0 : 0.5));
3660 3662
 
3661 3663
           #if ENABLED(DELTA)
3662 3664
             // Avoid probing outside the round or hexagonal area of a delta printer

Loading…
Cancel
Save