Browse Source

Replace MBL Z hacking

Scott Lahteine 8 years ago
parent
commit
3e927ff204
28 changed files with 148 additions and 195 deletions
  1. 5
    0
      Marlin/Conditionals_post.h
  2. 2
    2
      Marlin/Configuration.h
  3. 41
    96
      Marlin/Marlin_main.cpp
  4. 2
    0
      Marlin/SanityCheck.h
  5. 7
    14
      Marlin/enum.h
  6. 2
    2
      Marlin/example_configurations/Cartesio/Configuration.h
  7. 2
    2
      Marlin/example_configurations/Felix/Configuration.h
  8. 2
    2
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  9. 2
    2
      Marlin/example_configurations/Hephestos/Configuration.h
  10. 2
    2
      Marlin/example_configurations/Hephestos_2/Configuration.h
  11. 2
    2
      Marlin/example_configurations/K8200/Configuration.h
  12. 2
    2
      Marlin/example_configurations/K8400/Configuration.h
  13. 2
    2
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  14. 2
    2
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  15. 2
    2
      Marlin/example_configurations/RigidBot/Configuration.h
  16. 2
    2
      Marlin/example_configurations/SCARA/Configuration.h
  17. 2
    2
      Marlin/example_configurations/TAZ4/Configuration.h
  18. 2
    2
      Marlin/example_configurations/WITBOX/Configuration.h
  19. 2
    2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  20. 2
    2
      Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h
  21. 2
    2
      Marlin/example_configurations/delta/generic/Configuration.h
  22. 2
    2
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  23. 2
    2
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  24. 2
    2
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  25. 2
    2
      Marlin/example_configurations/makibox/Configuration.h
  26. 2
    2
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  27. 19
    0
      Marlin/mesh_bed_leveling.h
  28. 30
    41
      Marlin/ultralcd.cpp

+ 5
- 0
Marlin/Conditionals_post.h View File

709
   #ifndef Z_CLEARANCE_BETWEEN_PROBES
709
   #ifndef Z_CLEARANCE_BETWEEN_PROBES
710
     #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT
710
     #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT
711
   #endif
711
   #endif
712
+  #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT
713
+    #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES
714
+  #else
715
+    #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT
716
+  #endif
712
 
717
 
713
   #if IS_KINEMATIC
718
   #if IS_KINEMATIC
714
     // Check for this in the code instead
719
     // Check for this in the code instead

+ 2
- 2
Marlin/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 41
- 96
Marlin/Marlin_main.cpp View File

3450
   stepper.synchronize();
3450
   stepper.synchronize();
3451
 
3451
 
3452
   // Disable the leveling matrix before homing
3452
   // Disable the leveling matrix before homing
3453
-  #if PLANNER_LEVELING
3453
+  #if PLANNER_LEVELING || ENABLED(MESH_BED_LEVELING)
3454
     set_bed_leveling_enabled(false);
3454
     set_bed_leveling_enabled(false);
3455
   #endif
3455
   #endif
3456
 
3456
 
3464
     extruder_duplication_enabled = false;
3464
     extruder_duplication_enabled = false;
3465
   #endif
3465
   #endif
3466
 
3466
 
3467
-  /**
3468
-   * For mesh bed leveling deactivate the mesh calculations, will be turned
3469
-   * on again when homing all axis
3470
-   */
3471
-  #if ENABLED(MESH_BED_LEVELING)
3472
-    float pre_home_z = MESH_HOME_SEARCH_Z;
3473
-    if (mbl.active()) {
3474
-      #if ENABLED(DEBUG_LEVELING_FEATURE)
3475
-        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL was active");
3476
-      #endif
3477
-      // Use known Z position if already homed
3478
-      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
3479
-        set_bed_leveling_enabled(false);
3480
-        pre_home_z = current_position[Z_AXIS];
3481
-      }
3482
-      else {
3483
-        mbl.set_active(false);
3484
-        current_position[Z_AXIS] = pre_home_z;
3485
-      }
3486
-      #if ENABLED(DEBUG_LEVELING_FEATURE)
3487
-        if (DEBUGGING(LEVELING)) DEBUG_POS("Set Z to pre_home_z", current_position);
3488
-      #endif
3489
-    }
3490
-  #endif
3491
-
3492
   setup_for_endstop_or_probe_move();
3467
   setup_for_endstop_or_probe_move();
3493
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3468
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3494
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
3469
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
3620
 
3595
 
3621
   // Enable mesh leveling again
3596
   // Enable mesh leveling again
3622
   #if ENABLED(MESH_BED_LEVELING)
3597
   #if ENABLED(MESH_BED_LEVELING)
3623
-    if (mbl.has_mesh()) {
3624
-      #if ENABLED(DEBUG_LEVELING_FEATURE)
3625
-        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL has mesh");
3626
-      #endif
3598
+    if (mbl.reactivate()) {
3599
+      set_bed_leveling_enabled(true);
3627
       if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) {
3600
       if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) {
3628
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
3629
-          if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL Z homing");
3630
-        #endif
3631
-        current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
3632
-          #if Z_HOME_DIR > 0
3633
-            + Z_MAX_POS
3634
-          #endif
3635
-        ;
3636
-        SYNC_PLAN_POSITION_KINEMATIC();
3637
-        mbl.set_active(true);
3638
         #if ENABLED(MESH_G28_REST_ORIGIN)
3601
         #if ENABLED(MESH_G28_REST_ORIGIN)
3639
-          current_position[Z_AXIS] = 0.0;
3602
+          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
3640
           set_destination_to_current();
3603
           set_destination_to_current();
3641
           line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3604
           line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3642
           stepper.synchronize();
3605
           stepper.synchronize();
3643
-          #if ENABLED(DEBUG_LEVELING_FEATURE)
3644
-            if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Rest Origin", current_position);
3645
-          #endif
3646
-        #else
3647
-          planner.unapply_leveling(current_position);
3648
-          #if ENABLED(DEBUG_LEVELING_FEATURE)
3649
-            if (DEBUGGING(LEVELING)) DEBUG_POS("MBL adjusted MESH_HOME_SEARCH_Z", current_position);
3650
-          #endif
3651
-        #endif
3652
-      }
3653
-      else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) {
3654
-        current_position[Z_AXIS] = pre_home_z;
3655
-        SYNC_PLAN_POSITION_KINEMATIC();
3656
-        mbl.set_active(true);
3657
-        planner.unapply_leveling(current_position);
3658
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
3659
-          if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Home X or Y", current_position);
3660
         #endif
3606
         #endif
3661
       }
3607
       }
3662
     }
3608
     }
3664
 
3610
 
3665
   clean_up_after_endstop_or_probe_move();
3611
   clean_up_after_endstop_or_probe_move();
3666
 
3612
 
3667
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
3668
-    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
3669
-  #endif
3670
-
3671
   // Restore the active tool after homing
3613
   // Restore the active tool after homing
3672
   #if HOTENDS > 1
3614
   #if HOTENDS > 1
3673
     tool_change(old_tool_index, 0, true);
3615
     tool_change(old_tool_index, 0, true);
3674
   #endif
3616
   #endif
3675
 
3617
 
3676
   report_current_position();
3618
   report_current_position();
3619
+
3620
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
3621
+    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
3622
+  #endif
3677
 }
3623
 }
3678
 
3624
 
3679
 #if HAS_PROBING_PROCEDURE
3625
 #if HAS_PROBING_PROCEDURE
3690
 
3636
 
3691
   inline void _mbl_goto_xy(const float &x, const float &y) {
3637
   inline void _mbl_goto_xy(const float &x, const float &y) {
3692
     const float old_feedrate_mm_s = feedrate_mm_s;
3638
     const float old_feedrate_mm_s = feedrate_mm_s;
3693
-    feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3694
 
3639
 
3695
-    current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
3696
-      #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT
3697
-        + Z_CLEARANCE_BETWEEN_PROBES
3698
-      #elif Z_HOMING_HEIGHT > 0
3699
-        + Z_HOMING_HEIGHT
3700
-      #endif
3701
-    ;
3702
-    line_to_current_position();
3640
+    #if MANUAL_PROBE_HEIGHT > 0
3641
+      feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3642
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
3643
+      line_to_current_position();
3644
+    #endif
3703
 
3645
 
3704
     feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
3646
     feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
3705
     current_position[X_AXIS] = LOGICAL_X_POSITION(x);
3647
     current_position[X_AXIS] = LOGICAL_X_POSITION(x);
3706
     current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
3648
     current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
3707
     line_to_current_position();
3649
     line_to_current_position();
3708
 
3650
 
3709
-    #if Z_CLEARANCE_BETWEEN_PROBES > 0 || Z_HOMING_HEIGHT > 0
3651
+    #if MANUAL_PROBE_HEIGHT > 0
3710
       feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3652
       feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3711
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
3653
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + 0.2; // just slightly over the bed
3712
       line_to_current_position();
3654
       line_to_current_position();
3713
     #endif
3655
     #endif
3714
 
3656
 
3721
 
3663
 
3722
   void mbl_mesh_report() {
3664
   void mbl_mesh_report() {
3723
     SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS));
3665
     SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS));
3724
-    SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_SEARCH_Z));
3725
     SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3666
     SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3726
     SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3667
     SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3727
     for (uint8_t py = 0; py < MESH_NUM_Y_POINTS; py++) {
3668
     for (uint8_t py = 0; py < MESH_NUM_Y_POINTS; py++) {
3757
   inline void gcode_G29() {
3698
   inline void gcode_G29() {
3758
 
3699
 
3759
     static int probe_index = -1;
3700
     static int probe_index = -1;
3701
+    #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
3702
+      static bool enable_soft_endstops;
3703
+    #endif
3704
+
3760
     const MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_byte() : MeshReport;
3705
     const MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_byte() : MeshReport;
3761
     if (state < 0 || state > 5) {
3706
     if (state < 0 || state > 5) {
3762
       SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
3707
       SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
3788
         }
3733
         }
3789
         // For each G29 S2...
3734
         // For each G29 S2...
3790
         if (probe_index == 0) {
3735
         if (probe_index == 0) {
3791
-          // For the initial G29 S2 make Z a positive value (e.g., 4.0)
3792
-          current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
3793
-            #if Z_HOME_DIR > 0
3794
-              + Z_MAX_POS
3795
-            #endif
3796
-          ;
3797
-          SYNC_PLAN_POSITION_KINEMATIC();
3736
+          #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
3737
+            // For the initial G29 S2 save software endstop state
3738
+            enable_soft_endstops = soft_endstops_enabled;
3739
+          #endif
3798
         }
3740
         }
3799
         else {
3741
         else {
3800
           // For G29 S2 after adjusting Z.
3742
           // For G29 S2 after adjusting Z.
3801
           mbl.set_zigzag_z(probe_index - 1, current_position[Z_AXIS]);
3743
           mbl.set_zigzag_z(probe_index - 1, current_position[Z_AXIS]);
3744
+          #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
3745
+            soft_endstops_enabled = enable_soft_endstops;
3746
+          #endif
3802
         }
3747
         }
3803
         // If there's another point to sample, move there with optional lift.
3748
         // If there's another point to sample, move there with optional lift.
3804
         if (probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
3749
         if (probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
3805
           mbl.zigzag(probe_index, px, py);
3750
           mbl.zigzag(probe_index, px, py);
3806
           _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
3751
           _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
3752
+
3753
+          #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
3754
+            // Disable software endstops to allow manual adjustment
3755
+            // If G29 is not completed, they will not be re-enabled
3756
+            soft_endstops_enabled = false;
3757
+          #endif
3758
+
3807
           probe_index++;
3759
           probe_index++;
3808
         }
3760
         }
3809
         else {
3761
         else {
3810
           // One last "return to the bed" (as originally coded) at completion
3762
           // One last "return to the bed" (as originally coded) at completion
3811
-          current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
3812
-            #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT
3813
-              + Z_CLEARANCE_BETWEEN_PROBES
3814
-            #elif Z_HOMING_HEIGHT > 0
3815
-              + Z_HOMING_HEIGHT
3816
-            #endif
3817
-          ;
3763
+          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
3818
           line_to_current_position();
3764
           line_to_current_position();
3819
           stepper.synchronize();
3765
           stepper.synchronize();
3820
 
3766
 
3822
           SERIAL_PROTOCOLLNPGM("Mesh probing done.");
3768
           SERIAL_PROTOCOLLNPGM("Mesh probing done.");
3823
           probe_index = -1;
3769
           probe_index = -1;
3824
           mbl.set_has_mesh(true);
3770
           mbl.set_has_mesh(true);
3771
+          mbl.set_reactivate(true);
3825
           enqueue_and_echo_commands_P(PSTR("G28"));
3772
           enqueue_and_echo_commands_P(PSTR("G28"));
3773
+          #if HAS_BUZZER
3774
+            lcd_buzz(200, 659);
3775
+            lcd_buzz(200, 698);
3776
+          #endif
3826
         }
3777
         }
3827
         break;
3778
         break;
3828
 
3779
 
3871
         break;
3822
         break;
3872
 
3823
 
3873
       case MeshReset:
3824
       case MeshReset:
3874
-        if (mbl.active()) {
3875
-          current_position[Z_AXIS] -= MESH_HOME_SEARCH_Z;
3876
-          planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
3877
-          mbl.reset();
3878
-          SYNC_PLAN_POSITION_KINEMATIC();
3879
-        }
3880
-        else
3881
-          mbl.reset();
3825
+        reset_bed_level();
3826
+        break;
3882
 
3827
 
3883
     } // switch(state)
3828
     } // switch(state)
3884
 
3829
 

+ 2
- 0
Marlin/SanityCheck.h View File

130
   #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
130
   #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
131
 #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
131
 #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
132
   #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
132
   #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
133
+#elif defined(MESH_HOME_SEARCH_Z)
134
+  #error "MESH_HOME_SEARCH_Z is now MANUAL_PROBE_Z_RANGE. Please update your configuration."
133
 #elif !defined(MIN_STEPS_PER_SEGMENT)
135
 #elif !defined(MIN_STEPS_PER_SEGMENT)
134
   #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
136
   #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
135
 #elif defined(PREVENT_DANGEROUS_EXTRUDE)
137
 #elif defined(PREVENT_DANGEROUS_EXTRUDE)

+ 7
- 14
Marlin/enum.h View File

164
   };
164
   };
165
 #endif
165
 #endif
166
 
166
 
167
-#if ENABLED(MESH_BED_LEVELING)
168
-  enum MeshLevelingState {
169
-    MeshReport,
170
-    MeshStart,
171
-    MeshNext,
172
-    MeshSet,
173
-    MeshSetZOffset,
174
-    MeshReset
175
-  };
176
-
177
-  enum MBLStatus {
178
-    MBL_STATUS_NONE = 0,
179
-    MBL_STATUS_HAS_MESH_BIT = 0,
180
-    MBL_STATUS_ACTIVE_BIT = 1
167
+#if ENABLED(PROBE_MANUALLY)
168
+  enum ABLState {
169
+    ABLReport,
170
+    ABLStart,
171
+    ABLNext,
172
+    ABLSet,
173
+    ABLReset
181
   };
174
   };
182
 #endif
175
 #endif
183
 
176
 

+ 2
- 2
Marlin/example_configurations/Cartesio/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 2
- 2
Marlin/example_configurations/Felix/Configuration.h View File

733
   #define MESH_INSET 10        // Mesh inset margin on print area
733
   #define MESH_INSET 10        // Mesh inset margin on print area
734
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
734
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
735
   #define MESH_NUM_Y_POINTS 3
735
   #define MESH_NUM_Y_POINTS 3
736
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
736
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
737
 
737
 
738
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
738
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
739
 
739
 
740
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
740
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
741
 
741
 

+ 2
- 2
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

733
   #define MESH_INSET 10        // Mesh inset margin on print area
733
   #define MESH_INSET 10        // Mesh inset margin on print area
734
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
734
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
735
   #define MESH_NUM_Y_POINTS 3
735
   #define MESH_NUM_Y_POINTS 3
736
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
736
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
737
 
737
 
738
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
738
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
739
 
739
 
740
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
740
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
741
 
741
 

+ 2
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

742
   #define MESH_INSET 10        // Mesh inset margin on print area
742
   #define MESH_INSET 10        // Mesh inset margin on print area
743
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
743
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
744
   #define MESH_NUM_Y_POINTS 3
744
   #define MESH_NUM_Y_POINTS 3
745
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
745
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
746
 
746
 
747
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
747
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
748
 
748
 
749
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
749
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
750
 
750
 

+ 2
- 2
Marlin/example_configurations/Hephestos_2/Configuration.h View File

744
   #define MESH_INSET 10        // Mesh inset margin on print area
744
   #define MESH_INSET 10        // Mesh inset margin on print area
745
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
745
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
746
   #define MESH_NUM_Y_POINTS 3
746
   #define MESH_NUM_Y_POINTS 3
747
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
747
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
748
 
748
 
749
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
749
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
750
 
750
 
751
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
751
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
752
 
752
 

+ 2
- 2
Marlin/example_configurations/K8200/Configuration.h View File

779
   #define MESH_INSET 10        // Mesh inset margin on print area
779
   #define MESH_INSET 10        // Mesh inset margin on print area
780
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
780
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
781
   #define MESH_NUM_Y_POINTS 3
781
   #define MESH_NUM_Y_POINTS 3
782
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
782
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
783
 
783
 
784
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
784
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
785
 
785
 
786
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
786
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
787
 
787
 

+ 2
- 2
Marlin/example_configurations/K8400/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 2
- 2
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 2
- 2
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 2
- 2
Marlin/example_configurations/RigidBot/Configuration.h View File

749
   #define MESH_INSET 10        // Mesh inset margin on print area
749
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
750
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_Y_POINTS 3
751
   #define MESH_NUM_Y_POINTS 3
752
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
752
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
753
 
753
 
754
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
754
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
755
 
755
 
756
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
756
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
 
757
 

+ 2
- 2
Marlin/example_configurations/SCARA/Configuration.h View File

765
   #define MESH_INSET 10        // Mesh inset margin on print area
765
   #define MESH_INSET 10        // Mesh inset margin on print area
766
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
766
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
767
   #define MESH_NUM_Y_POINTS 3
767
   #define MESH_NUM_Y_POINTS 3
768
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
768
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
769
 
769
 
770
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
770
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
771
 
771
 
772
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
772
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
773
 
773
 

+ 2
- 2
Marlin/example_configurations/TAZ4/Configuration.h View File

771
   #define MESH_INSET 10        // Mesh inset margin on print area
771
   #define MESH_INSET 10        // Mesh inset margin on print area
772
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
772
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
773
   #define MESH_NUM_Y_POINTS 3
773
   #define MESH_NUM_Y_POINTS 3
774
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
774
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
775
 
775
 
776
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
776
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
777
 
777
 
778
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
778
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
779
 
779
 

+ 2
- 2
Marlin/example_configurations/WITBOX/Configuration.h View File

742
   #define MESH_INSET 10        // Mesh inset margin on print area
742
   #define MESH_INSET 10        // Mesh inset margin on print area
743
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
743
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
744
   #define MESH_NUM_Y_POINTS 3
744
   #define MESH_NUM_Y_POINTS 3
745
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
745
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
746
 
746
 
747
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
747
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
748
 
748
 
749
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
749
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
750
 
750
 

+ 2
- 2
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

750
   #define MESH_INSET 10        // Mesh inset margin on print area
750
   #define MESH_INSET 10        // Mesh inset margin on print area
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752
   #define MESH_NUM_Y_POINTS 3
752
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
753
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754
 
754
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
755
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756
 
756
 
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758
 
758
 

+ 2
- 2
Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h View File

853
   #define MESH_INSET 10        // Mesh inset margin on print area
853
   #define MESH_INSET 10        // Mesh inset margin on print area
854
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
854
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
855
   #define MESH_NUM_Y_POINTS 3
855
   #define MESH_NUM_Y_POINTS 3
856
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
856
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
857
 
857
 
858
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
858
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
859
 
859
 
860
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
860
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
861
 
861
 

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration.h View File

836
   #define MESH_INSET 10        // Mesh inset margin on print area
836
   #define MESH_INSET 10        // Mesh inset margin on print area
837
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
837
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
838
   #define MESH_NUM_Y_POINTS 3
838
   #define MESH_NUM_Y_POINTS 3
839
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
839
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
840
 
840
 
841
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
841
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
842
 
842
 
843
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
843
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
844
 
844
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

839
   #define MESH_INSET 10        // Mesh inset margin on print area
839
   #define MESH_INSET 10        // Mesh inset margin on print area
840
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
840
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
841
   #define MESH_NUM_Y_POINTS 3
841
   #define MESH_NUM_Y_POINTS 3
842
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
842
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
843
 
843
 
844
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
844
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
845
 
845
 
846
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
846
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
847
 
847
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

838
   #define MESH_INSET 10        // Mesh inset margin on print area
838
   #define MESH_INSET 10        // Mesh inset margin on print area
839
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
839
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
840
   #define MESH_NUM_Y_POINTS 3
840
   #define MESH_NUM_Y_POINTS 3
841
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
841
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
842
 
842
 
843
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
843
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
844
 
844
 
845
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
845
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
846
 
846
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

842
   #define MESH_INSET 10        // Mesh inset margin on print area
842
   #define MESH_INSET 10        // Mesh inset margin on print area
843
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
843
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
844
   #define MESH_NUM_Y_POINTS 3
844
   #define MESH_NUM_Y_POINTS 3
845
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
845
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
846
 
846
 
847
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
847
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
848
 
848
 
849
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
849
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
850
 
850
 

+ 2
- 2
Marlin/example_configurations/makibox/Configuration.h View File

753
   #define MESH_INSET 10        // Mesh inset margin on print area
753
   #define MESH_INSET 10        // Mesh inset margin on print area
754
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
754
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
755
   #define MESH_NUM_Y_POINTS 3
755
   #define MESH_NUM_Y_POINTS 3
756
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
756
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
757
 
757
 
758
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
758
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
759
 
759
 
760
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
760
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
761
 
761
 

+ 2
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

746
   #define MESH_INSET 10        // Mesh inset margin on print area
746
   #define MESH_INSET 10        // Mesh inset margin on print area
747
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
747
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
748
   #define MESH_NUM_Y_POINTS 3
748
   #define MESH_NUM_Y_POINTS 3
749
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
749
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
750
 
750
 
751
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
751
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
752
 
752
 
753
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
753
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
754
 
754
 

+ 19
- 0
Marlin/mesh_bed_leveling.h View File

23
 #include "Marlin.h"
23
 #include "Marlin.h"
24
 
24
 
25
 #if ENABLED(MESH_BED_LEVELING)
25
 #if ENABLED(MESH_BED_LEVELING)
26
+
27
+  enum MeshLevelingState {
28
+    MeshReport,
29
+    MeshStart,
30
+    MeshNext,
31
+    MeshSet,
32
+    MeshSetZOffset,
33
+    MeshReset
34
+  };
35
+
36
+  enum MBLStatus {
37
+    MBL_STATUS_NONE = 0,
38
+    MBL_STATUS_HAS_MESH_BIT = 0,
39
+    MBL_STATUS_ACTIVE_BIT = 1,
40
+    MBL_STATUS_REACTIVATE_BIT = 2
41
+  };
42
+
26
   #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1))
43
   #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1))
27
   #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1))
44
   #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1))
28
 
45
 
44
     void set_active(const bool onOff)   { onOff ? SBI(status, MBL_STATUS_ACTIVE_BIT) : CBI(status, MBL_STATUS_ACTIVE_BIT); }
61
     void set_active(const bool onOff)   { onOff ? SBI(status, MBL_STATUS_ACTIVE_BIT) : CBI(status, MBL_STATUS_ACTIVE_BIT); }
45
     bool has_mesh() const               { return TEST(status, MBL_STATUS_HAS_MESH_BIT); }
62
     bool has_mesh() const               { return TEST(status, MBL_STATUS_HAS_MESH_BIT); }
46
     void set_has_mesh(const bool onOff) { onOff ? SBI(status, MBL_STATUS_HAS_MESH_BIT) : CBI(status, MBL_STATUS_HAS_MESH_BIT); }
63
     void set_has_mesh(const bool onOff) { onOff ? SBI(status, MBL_STATUS_HAS_MESH_BIT) : CBI(status, MBL_STATUS_HAS_MESH_BIT); }
64
+    bool reactivate()                   { bool b = TEST(status, MBL_STATUS_REACTIVATE_BIT); CBI(status, MBL_STATUS_REACTIVATE_BIT); return b; }
65
+    void set_reactivate(const bool onOff) { onOff ? SBI(status, MBL_STATUS_REACTIVATE_BIT) : CBI(status, MBL_STATUS_REACTIVATE_BIT); }
47
 
66
 
48
     inline void zigzag(const int8_t index, int8_t &px, int8_t &py) const {
67
     inline void zigzag(const int8_t index, int8_t &px, int8_t &py) const {
49
       px = index % (MESH_NUM_X_POINTS);
68
       px = index % (MESH_NUM_X_POINTS);

+ 30
- 41
Marlin/ultralcd.cpp View File

1223
     static uint8_t _lcd_level_bed_position;
1223
     static uint8_t _lcd_level_bed_position;
1224
 
1224
 
1225
     // Utility to go to the next mesh point
1225
     // Utility to go to the next mesh point
1226
-    // A raise is added between points if Z_HOMING_HEIGHT is in use
1227
-    // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z
1228
-    // Z position will be restored with the final action, a G28
1229
-    inline void _mbl_goto_xy(float x, float y) {
1226
+    inline void _manual_probe_xy(float x, float y) {
1230
       if (no_reentrance) return;
1227
       if (no_reentrance) return;
1231
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT);
1232
-      line_to_current(Z_AXIS);
1228
+      #if MANUAL_PROBE_HEIGHT > 0
1229
+        current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1230
+        line_to_current(Z_AXIS);
1231
+      #endif
1233
       current_position[X_AXIS] = LOGICAL_X_POSITION(x);
1232
       current_position[X_AXIS] = LOGICAL_X_POSITION(x);
1234
       current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1233
       current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1235
       planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1234
       planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1236
-      #if Z_HOMING_HEIGHT > 0
1237
-        current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
1235
+      #if MANUAL_PROBE_HEIGHT > 0
1236
+        current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + 0.2;
1238
         line_to_current(Z_AXIS);
1237
         line_to_current(Z_AXIS);
1239
       #endif
1238
       #endif
1240
       lcd_synchronize();
1239
       lcd_synchronize();
1259
       if (encoderPosition) {
1258
       if (encoderPosition) {
1260
         refresh_cmd_timeout();
1259
         refresh_cmd_timeout();
1261
         current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
1260
         current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
1262
-        NOLESS(current_position[Z_AXIS], 0);
1263
-        NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2);
1261
+        NOLESS(current_position[Z_AXIS], -(MANUAL_PROBE_Z_RANGE) * 0.5);
1262
+        NOMORE(current_position[Z_AXIS], (MANUAL_PROBE_Z_RANGE) * 0.5);
1264
         line_to_current(Z_AXIS);
1263
         line_to_current(Z_AXIS);
1265
         lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
1264
         lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
1266
         encoderPosition = 0;
1265
         encoderPosition = 0;
1267
       }
1266
       }
1268
 
1267
 
1269
-      static bool debounce_click = false;
1270
       if (lcd_clicked) {
1268
       if (lcd_clicked) {
1271
-        if (!debounce_click) {
1272
-          debounce_click = true; // ignore multiple "clicks" in a row
1273
-          mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]);
1274
-          if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
1275
-            lcd_goto_screen(_lcd_level_bed_done);
1269
+        mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]);
1270
+        if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
1271
+          lcd_goto_screen(_lcd_level_bed_done);
1276
 
1272
 
1277
-            current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT;
1273
+          #if MANUAL_PROBE_HEIGHT > 0
1274
+            current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1278
             line_to_current(Z_AXIS);
1275
             line_to_current(Z_AXIS);
1279
             lcd_synchronize();
1276
             lcd_synchronize();
1277
+          #endif
1280
 
1278
 
1281
-            mbl.set_has_mesh(true);
1282
-            enqueue_and_echo_commands_P(PSTR("G28"));
1283
-            lcd_return_to_status();
1284
-            //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
1285
-            #if HAS_BUZZER
1286
-              lcd_buzz(200, 659);
1287
-              lcd_buzz(200, 698);
1288
-            #endif
1289
-          }
1290
-          else {
1291
-            lcd_goto_screen(_lcd_level_goto_next_point);
1292
-          }
1279
+          mbl.set_has_mesh(true);
1280
+          mbl.set_reactivate(true);
1281
+          enqueue_and_echo_commands_P(PSTR("G28"));
1282
+          lcd_return_to_status();
1283
+          //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
1284
+          #if HAS_BUZZER
1285
+            lcd_buzz(200, 659);
1286
+            lcd_buzz(200, 698);
1287
+          #endif
1288
+        }
1289
+        else {
1290
+          lcd_goto_screen(_lcd_level_goto_next_point);
1293
         }
1291
         }
1294
-      }
1295
-      else {
1296
-        debounce_click = false;
1297
       }
1292
       }
1298
 
1293
 
1299
 KeepDrawing:
1294
 KeepDrawing:
1300
       // Update on first display, then only on updates to Z position
1295
       // Update on first display, then only on updates to Z position
1301
       // Show message above on clicks instead
1296
       // Show message above on clicks instead
1302
       if (lcdDrawUpdate) {
1297
       if (lcdDrawUpdate) {
1303
-        float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
1298
+        const float v = current_position[Z_AXIS];
1304
         lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
1299
         lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
1305
       }
1300
       }
1306
 
1301
 
1326
       // Set the menu to display ahead of blocking call
1321
       // Set the menu to display ahead of blocking call
1327
       lcd_goto_screen(_lcd_level_bed_moving);
1322
       lcd_goto_screen(_lcd_level_bed_moving);
1328
 
1323
 
1329
-      // _mbl_goto_xy runs the menu loop until the move is done
1324
+      // _manual_probe_xy runs the menu loop until the move is done
1330
       int8_t px, py;
1325
       int8_t px, py;
1331
       mbl.zigzag(_lcd_level_bed_position, px, py);
1326
       mbl.zigzag(_lcd_level_bed_position, px, py);
1332
-      _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
1327
+      _manual_probe_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
1333
 
1328
 
1334
       // After the blocking function returns, change menus
1329
       // After the blocking function returns, change menus
1335
       lcd_goto_screen(_lcd_level_bed_get_z);
1330
       lcd_goto_screen(_lcd_level_bed_get_z);
1343
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
1338
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
1344
       if (lcd_clicked) {
1339
       if (lcd_clicked) {
1345
         _lcd_level_bed_position = 0;
1340
         _lcd_level_bed_position = 0;
1346
-        current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
1347
-          #if Z_HOME_DIR > 0
1348
-            + Z_MAX_POS
1349
-          #endif
1350
-        ;
1351
-        planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1352
         lcd_goto_screen(_lcd_level_goto_next_point);
1341
         lcd_goto_screen(_lcd_level_goto_next_point);
1353
       }
1342
       }
1354
     }
1343
     }

Loading…
Cancel
Save