Browse Source

Merge pull request #6031 from thinkyhead/rc_mbl_z_unhack

MBL: Disable sw endstops instead of altering Z
Scott Lahteine 8 years ago
parent
commit
d15f25539b
30 changed files with 332 additions and 343 deletions
  1. 2
    0
      Marlin/Conditionals_LCD.h
  2. 5
    0
      Marlin/Conditionals_post.h
  3. 9
    8
      Marlin/Configuration.h
  4. 1
    1
      Marlin/Marlin.h
  5. 49
    105
      Marlin/Marlin_main.cpp
  6. 4
    0
      Marlin/SanityCheck.h
  7. 7
    14
      Marlin/enum.h
  8. 9
    8
      Marlin/example_configurations/Cartesio/Configuration.h
  9. 8
    7
      Marlin/example_configurations/Felix/Configuration.h
  10. 9
    8
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  11. 9
    8
      Marlin/example_configurations/Hephestos/Configuration.h
  12. 9
    8
      Marlin/example_configurations/Hephestos_2/Configuration.h
  13. 9
    8
      Marlin/example_configurations/K8200/Configuration.h
  14. 9
    8
      Marlin/example_configurations/K8400/Configuration.h
  15. 9
    8
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  16. 9
    8
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  17. 9
    8
      Marlin/example_configurations/RigidBot/Configuration.h
  18. 9
    8
      Marlin/example_configurations/SCARA/Configuration.h
  19. 9
    8
      Marlin/example_configurations/TAZ4/Configuration.h
  20. 9
    8
      Marlin/example_configurations/WITBOX/Configuration.h
  21. 9
    8
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  22. 9
    8
      Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h
  23. 9
    8
      Marlin/example_configurations/delta/generic/Configuration.h
  24. 9
    8
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  25. 9
    8
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  26. 9
    8
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  27. 9
    8
      Marlin/example_configurations/makibox/Configuration.h
  28. 9
    8
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  29. 19
    0
      Marlin/mesh_bed_leveling.h
  30. 48
    48
      Marlin/ultralcd.cpp

+ 2
- 0
Marlin/Conditionals_LCD.h View File

@@ -369,4 +369,6 @@
369 369
     #undef Z_MIN_PROBE_ENDSTOP
370 370
   #endif
371 371
 
372
+  #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
373
+
372 374
 #endif //CONDITIONALS_LCD_H

+ 5
- 0
Marlin/Conditionals_post.h View File

@@ -709,6 +709,11 @@
709 709
   #ifndef Z_CLEARANCE_BETWEEN_PROBES
710 710
     #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT
711 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 718
   #if IS_KINEMATIC
714 719
     // Check for this in the code instead

+ 9
- 8
Marlin/Configuration.h View File

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 200
726 722
 #define Z_MAX_POS 200
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

+ 1
- 1
Marlin/Marlin.h View File

@@ -304,7 +304,7 @@ extern float current_position[NUM_AXIS];
304 304
 extern float soft_endstop_min[XYZ];
305 305
 extern float soft_endstop_max[XYZ];
306 306
 
307
-#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
307
+#if HAS_SOFTWARE_ENDSTOPS
308 308
   extern bool soft_endstops_enabled;
309 309
   void clamp_to_software_endstops(float target[XYZ]);
310 310
 #else

+ 49
- 105
Marlin/Marlin_main.cpp View File

@@ -414,7 +414,7 @@ float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DI
414 414
 #endif
415 415
 
416 416
 // Software Endstops are based on the configured limits.
417
-#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
417
+#if HAS_SOFTWARE_ENDSTOPS
418 418
   bool soft_endstops_enabled = true;
419 419
 #endif
420 420
 float soft_endstop_min[XYZ] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
@@ -3450,7 +3450,7 @@ inline void gcode_G28() {
3450 3450
   stepper.synchronize();
3451 3451
 
3452 3452
   // Disable the leveling matrix before homing
3453
-  #if PLANNER_LEVELING
3453
+  #if PLANNER_LEVELING || ENABLED(MESH_BED_LEVELING)
3454 3454
     set_bed_leveling_enabled(false);
3455 3455
   #endif
3456 3456
 
@@ -3464,31 +3464,6 @@ inline void gcode_G28() {
3464 3464
     extruder_duplication_enabled = false;
3465 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 3467
   setup_for_endstop_or_probe_move();
3493 3468
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3494 3469
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
@@ -3620,43 +3595,14 @@ inline void gcode_G28() {
3620 3595
 
3621 3596
   // Enable mesh leveling again
3622 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 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 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 3603
           set_destination_to_current();
3641 3604
           line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3642 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 3606
         #endif
3661 3607
       }
3662 3608
     }
@@ -3664,16 +3610,16 @@ inline void gcode_G28() {
3664 3610
 
3665 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 3613
   // Restore the active tool after homing
3672 3614
   #if HOTENDS > 1
3673 3615
     tool_change(old_tool_index, 0, true);
3674 3616
   #endif
3675 3617
 
3676 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 3625
 #if HAS_PROBING_PROCEDURE
@@ -3690,25 +3636,21 @@ inline void gcode_G28() {
3690 3636
 
3691 3637
   inline void _mbl_goto_xy(const float &x, const float &y) {
3692 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 3646
     feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
3705 3647
     current_position[X_AXIS] = LOGICAL_X_POSITION(x);
3706 3648
     current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
3707 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 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 3654
       line_to_current_position();
3713 3655
     #endif
3714 3656
 
@@ -3721,7 +3663,6 @@ inline void gcode_G28() {
3721 3663
 
3722 3664
   void mbl_mesh_report() {
3723 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 3666
     SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
3726 3667
     SERIAL_PROTOCOLLNPGM("\nMeasured points:");
3727 3668
     for (uint8_t py = 0; py < MESH_NUM_Y_POINTS; py++) {
@@ -3757,6 +3698,10 @@ inline void gcode_G28() {
3757 3698
   inline void gcode_G29() {
3758 3699
 
3759 3700
     static int probe_index = -1;
3701
+    #if HAS_SOFTWARE_ENDSTOPS
3702
+      static bool enable_soft_endstops;
3703
+    #endif
3704
+
3760 3705
     const MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_byte() : MeshReport;
3761 3706
     if (state < 0 || state > 5) {
3762 3707
       SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
@@ -3788,33 +3733,34 @@ inline void gcode_G28() {
3788 3733
         }
3789 3734
         // For each G29 S2...
3790 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 HAS_SOFTWARE_ENDSTOPS
3737
+            // For the initial G29 S2 save software endstop state
3738
+            enable_soft_endstops = soft_endstops_enabled;
3739
+          #endif
3798 3740
         }
3799 3741
         else {
3800 3742
           // For G29 S2 after adjusting Z.
3801 3743
           mbl.set_zigzag_z(probe_index - 1, current_position[Z_AXIS]);
3744
+          #if HAS_SOFTWARE_ENDSTOPS
3745
+            soft_endstops_enabled = enable_soft_endstops;
3746
+          #endif
3802 3747
         }
3803 3748
         // If there's another point to sample, move there with optional lift.
3804 3749
         if (probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
3805 3750
           mbl.zigzag(probe_index, px, py);
3806 3751
           _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
3752
+
3753
+          #if HAS_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 3759
           probe_index++;
3808 3760
         }
3809 3761
         else {
3810 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 3764
           line_to_current_position();
3819 3765
           stepper.synchronize();
3820 3766
 
@@ -3822,7 +3768,12 @@ inline void gcode_G28() {
3822 3768
           SERIAL_PROTOCOLLNPGM("Mesh probing done.");
3823 3769
           probe_index = -1;
3824 3770
           mbl.set_has_mesh(true);
3771
+          mbl.set_reactivate(true);
3825 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 3778
         break;
3828 3779
 
@@ -3871,14 +3822,8 @@ inline void gcode_G28() {
3871 3822
         break;
3872 3823
 
3873 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 3828
     } // switch(state)
3884 3829
 
@@ -6427,10 +6372,8 @@ inline void gcode_M205() {
6427 6372
  */
6428 6373
 inline void gcode_M211() {
6429 6374
   SERIAL_ECHO_START;
6430
-  #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
6375
+  #if HAS_SOFTWARE_ENDSTOPS
6431 6376
     if (code_seen('S')) soft_endstops_enabled = code_value_bool();
6432
-  #endif
6433
-  #if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
6434 6377
     SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS);
6435 6378
     serialprintPGM(soft_endstops_enabled ? PSTR(MSG_ON) : PSTR(MSG_OFF));
6436 6379
   #else
@@ -7946,7 +7889,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
7946 7889
               && (delayed_move_time || current_position[X_AXIS] != xhome)
7947 7890
           ) {
7948 7891
             float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT;
7949
-            #if ENABLED(max_software_endstops)
7892
+            #if ENABLED(MAX_SOFTWARE_ENDSTOPS)
7950 7893
               NOMORE(raised_z, soft_endstop_max[Z_AXIS]);
7951 7894
             #endif
7952 7895
             #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -7997,7 +7940,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
7997 7940
               // record raised toolhead position for use by unpark
7998 7941
               COPY(raised_parked_position, current_position);
7999 7942
               raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
8000
-              #if ENABLED(max_software_endstops)
7943
+              #if ENABLED(MAX_SOFTWARE_ENDSTOPS)
8001 7944
                 NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]);
8002 7945
               #endif
8003 7946
               active_extruder_parked = true;
@@ -9033,18 +8976,19 @@ void ok_to_send() {
9033 8976
   SERIAL_EOL;
9034 8977
 }
9035 8978
 
9036
-#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
8979
+#if HAS_SOFTWARE_ENDSTOPS
9037 8980
 
9038 8981
   /**
9039 8982
    * Constrain the given coordinates to the software endstops.
9040 8983
    */
9041 8984
   void clamp_to_software_endstops(float target[XYZ]) {
9042
-    #if ENABLED(min_software_endstops)
8985
+    if (!soft_endstops_enabled) return;
8986
+    #if ENABLED(MIN_SOFTWARE_ENDSTOPS)
9043 8987
       NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]);
9044 8988
       NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]);
9045 8989
       NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]);
9046 8990
     #endif
9047
-    #if ENABLED(max_software_endstops)
8991
+    #if ENABLED(MAX_SOFTWARE_ENDSTOPS)
9048 8992
       NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]);
9049 8993
       NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]);
9050 8994
       NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]);

+ 4
- 0
Marlin/SanityCheck.h View File

@@ -130,6 +130,8 @@
130 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 131
 #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
132 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 135
 #elif !defined(MIN_STEPS_PER_SEGMENT)
134 136
   #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
135 137
 #elif defined(PREVENT_DANGEROUS_EXTRUDE)
@@ -156,6 +158,8 @@
156 158
   #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
157 159
 #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN)
158 160
   #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
161
+#elif defined(min_software_endstops) || defined(max_software_endstops)
162
+  #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
159 163
 #endif
160 164
 
161 165
 /**

+ 7
- 14
Marlin/enum.h View File

@@ -164,20 +164,13 @@ enum TempState {
164 164
   };
165 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 175
 #endif
183 176
 

+ 9
- 8
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 270
726 722
 #define Z_MAX_POS 400
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

+ 8
- 7
Marlin/example_configurations/Felix/Configuration.h View File

@@ -688,16 +688,12 @@
688 688
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
689 689
                              // Be sure you have this distance over your Z_MAX_POS in case.
690 690
 
691
-// ENDSTOP SETTINGS:
692
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
691
+// Direction of endstops when homing; 1=MAX, -1=MIN
693 692
 // :[-1, 1]
694 693
 #define X_HOME_DIR -1
695 694
 #define Y_HOME_DIR -1
696 695
 #define Z_HOME_DIR -1
697 696
 
698
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
699
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
700
-
701 697
 // @section machine
702 698
 
703 699
 // Travel limits after homing (units are in mm)
@@ -708,6 +704,11 @@
708 704
 #define Y_MAX_POS 205
709 705
 #define Z_MAX_POS 235
710 706
 
707
+// If enabled, axes won't move below MIN_POS in response to movement commands.
708
+#define MIN_SOFTWARE_ENDSTOPS
709
+// If enabled, axes won't move above MAX_POS in response to movement commands.
710
+#define MAX_SOFTWARE_ENDSTOPS
711
+
711 712
 /**
712 713
  * Filament Runout Sensor
713 714
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -733,9 +734,9 @@
733 734
   #define MESH_INSET 10        // Mesh inset margin on print area
734 735
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
735 736
   #define MESH_NUM_Y_POINTS 3
736
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
737
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
737 738
 
738
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
739
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
739 740
 
740 741
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
741 742
 

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

@@ -688,16 +688,12 @@
688 688
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
689 689
                              // Be sure you have this distance over your Z_MAX_POS in case.
690 690
 
691
-// ENDSTOP SETTINGS:
692
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
693
-// :[-1, 1]
691
+// Direction of endstops when homing; 1=MAX, -1=MIN
692
+// :[-1,1]
694 693
 #define X_HOME_DIR -1
695 694
 #define Y_HOME_DIR -1
696 695
 #define Z_HOME_DIR -1
697 696
 
698
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
699
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
700
-
701 697
 // @section machine
702 698
 
703 699
 // Travel limits after homing (units are in mm)
@@ -708,6 +704,11 @@
708 704
 #define Y_MAX_POS 205
709 705
 #define Z_MAX_POS 235
710 706
 
707
+// If enabled, axes won't move below MIN_POS in response to movement commands.
708
+#define MIN_SOFTWARE_ENDSTOPS
709
+// If enabled, axes won't move above MAX_POS in response to movement commands.
710
+#define MAX_SOFTWARE_ENDSTOPS
711
+
711 712
 /**
712 713
  * Filament Runout Sensor
713 714
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -733,9 +734,9 @@
733 734
   #define MESH_INSET 10        // Mesh inset margin on print area
734 735
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
735 736
   #define MESH_NUM_Y_POINTS 3
736
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
737
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
737 738
 
738
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
739
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
739 740
 
740 741
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
741 742
 

+ 9
- 8
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -697,16 +697,12 @@
697 697
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
698 698
                              // Be sure you have this distance over your Z_MAX_POS in case.
699 699
 
700
-// ENDSTOP SETTINGS:
701
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
702
-// :[-1, 1]
700
+// Direction of endstops when homing; 1=MAX, -1=MIN
701
+// :[-1,1]
703 702
 #define X_HOME_DIR -1
704 703
 #define Y_HOME_DIR -1
705 704
 #define Z_HOME_DIR -1
706 705
 
707
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
708
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
709
-
710 706
 // @section machine
711 707
 
712 708
 // Travel limits after homing (units are in mm)
@@ -717,6 +713,11 @@
717 713
 #define Y_MAX_POS 210
718 714
 #define Z_MAX_POS 180
719 715
 
716
+// If enabled, axes won't move below MIN_POS in response to movement commands.
717
+#define MIN_SOFTWARE_ENDSTOPS
718
+// If enabled, axes won't move above MAX_POS in response to movement commands.
719
+#define MAX_SOFTWARE_ENDSTOPS
720
+
720 721
 /**
721 722
  * Filament Runout Sensor
722 723
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -742,9 +743,9 @@
742 743
   #define MESH_INSET 10        // Mesh inset margin on print area
743 744
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
744 745
   #define MESH_NUM_Y_POINTS 3
745
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
746
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
746 747
 
747
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
748
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
748 749
 
749 750
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
750 751
 

+ 9
- 8
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -699,16 +699,12 @@
699 699
 #define Z_HOMING_HEIGHT 5    // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
700 700
                              // Be sure you have this distance over your Z_MAX_POS in case.
701 701
 
702
-// ENDSTOP SETTINGS:
703
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
704
-// :[-1, 1]
702
+// Direction of endstops when homing; 1=MAX, -1=MIN
703
+// :[-1,1]
705 704
 #define X_HOME_DIR -1
706 705
 #define Y_HOME_DIR -1
707 706
 #define Z_HOME_DIR -1
708 707
 
709
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
710
-#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
711
-
712 708
 // @section machine
713 709
 
714 710
 // Travel limits after homing (units are in mm)
@@ -719,6 +715,11 @@
719 715
 #define Y_MAX_POS 297
720 716
 #define Z_MAX_POS 210
721 717
 
718
+// If enabled, axes won't move below MIN_POS in response to movement commands.
719
+#define MIN_SOFTWARE_ENDSTOPS
720
+// If enabled, axes won't move above MAX_POS in response to movement commands.
721
+#define MAX_SOFTWARE_ENDSTOPS
722
+
722 723
 /**
723 724
  * Filament Runout Sensor
724 725
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -744,9 +745,9 @@
744 745
   #define MESH_INSET 10        // Mesh inset margin on print area
745 746
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
746 747
   #define MESH_NUM_Y_POINTS 3
747
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
748
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
748 749
 
749
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
750
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
750 751
 
751 752
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
752 753
 

+ 9
- 8
Marlin/example_configurations/K8200/Configuration.h View File

@@ -734,16 +734,12 @@
734 734
 #define Z_HOMING_HEIGHT 4   // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
735 735
                             // Be sure you have this distance over your Z_MAX_POS in case.
736 736
 
737
-// ENDSTOP SETTINGS:
738
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
739
-// :[-1, 1]
737
+// Direction of endstops when homing; 1=MAX, -1=MIN
738
+// :[-1,1]
740 739
 #define X_HOME_DIR -1
741 740
 #define Y_HOME_DIR -1
742 741
 #define Z_HOME_DIR -1
743 742
 
744
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
745
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
746
-
747 743
 // @section machine
748 744
 
749 745
 // Travel limits after homing (units are in mm)
@@ -754,6 +750,11 @@
754 750
 #define Y_MAX_POS 200
755 751
 #define Z_MAX_POS 200
756 752
 
753
+// If enabled, axes won't move below MIN_POS in response to movement commands.
754
+#define MIN_SOFTWARE_ENDSTOPS
755
+// If enabled, axes won't move above MAX_POS in response to movement commands.
756
+#define MAX_SOFTWARE_ENDSTOPS
757
+
757 758
 /**
758 759
  * Filament Runout Sensor
759 760
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -779,9 +780,9 @@
779 780
   #define MESH_INSET 10        // Mesh inset margin on print area
780 781
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
781 782
   #define MESH_NUM_Y_POINTS 3
782
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
783
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
783 784
 
784
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
785
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
785 786
 
786 787
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
787 788
 

+ 9
- 8
Marlin/example_configurations/K8400/Configuration.h View File

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 200
726 722
 #define Z_MAX_POS 190
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

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

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 200
726 722
 #define Z_MAX_POS 190
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

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

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 200
726 722
 #define Z_MAX_POS 200
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

+ 9
- 8
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -704,16 +704,12 @@
704 704
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
705 705
                              // Be sure you have this distance over your Z_MAX_POS in case.
706 706
 
707
-// ENDSTOP SETTINGS:
708
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
709
-// :[-1, 1]
707
+// Direction of endstops when homing; 1=MAX, -1=MIN
708
+// :[-1,1]
710 709
 #define X_HOME_DIR -1
711 710
 #define Y_HOME_DIR -1
712 711
 #define Z_HOME_DIR -1
713 712
 
714
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
715
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
716
-
717 713
 // @section machine
718 714
 
719 715
 // Travel limits after homing (units are in mm)
@@ -724,6 +720,11 @@
724 720
 #define Y_MAX_POS 248  // RigidBot regular is 248mm, RigitBot Big is 304mm
725 721
 #define Z_MAX_POS 254  // RigidBot regular and Big are 254mm
726 722
 
723
+// If enabled, axes won't move below MIN_POS in response to movement commands.
724
+#define MIN_SOFTWARE_ENDSTOPS
725
+// If enabled, axes won't move above MAX_POS in response to movement commands.
726
+#define MAX_SOFTWARE_ENDSTOPS
727
+
727 728
 /**
728 729
  * Filament Runout Sensor
729 730
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -749,9 +750,9 @@
749 750
   #define MESH_INSET 10        // Mesh inset margin on print area
750 751
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
751 752
   #define MESH_NUM_Y_POINTS 3
752
-  #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
753 754
 
754
-  //#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
755 756
 
756 757
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
757 758
 

+ 9
- 8
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -720,16 +720,12 @@
720 720
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
721 721
                              // Be sure you have this distance over your Z_MAX_POS in case.
722 722
 
723
-// ENDSTOP SETTINGS:
724
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
725
-// :[-1, 1]
723
+// Direction of endstops when homing; 1=MAX, -1=MIN
724
+// :[-1,1]
726 725
 #define X_HOME_DIR 1
727 726
 #define Y_HOME_DIR 1
728 727
 #define Z_HOME_DIR -1
729 728
 
730
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
731
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
732
-
733 729
 // @section machine
734 730
 
735 731
 // Travel limits after homing (units are in mm)
@@ -740,6 +736,11 @@
740 736
 #define Y_MAX_POS 200
741 737
 #define Z_MAX_POS 225
742 738
 
739
+// If enabled, axes won't move below MIN_POS in response to movement commands.
740
+#define MIN_SOFTWARE_ENDSTOPS
741
+// If enabled, axes won't move above MAX_POS in response to movement commands.
742
+#define MAX_SOFTWARE_ENDSTOPS
743
+
743 744
 /**
744 745
  * Filament Runout Sensor
745 746
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -765,9 +766,9 @@
765 766
   #define MESH_INSET 10        // Mesh inset margin on print area
766 767
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
767 768
   #define MESH_NUM_Y_POINTS 3
768
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
769
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
769 770
 
770
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
771
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
771 772
 
772 773
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
773 774
 

+ 9
- 8
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -726,16 +726,12 @@
726 726
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
727 727
                              // Be sure you have this distance over your Z_MAX_POS in case.
728 728
 
729
-// ENDSTOP SETTINGS:
730
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
731
-// :[-1, 1]
729
+// Direction of endstops when homing; 1=MAX, -1=MIN
730
+// :[-1,1]
732 731
 #define X_HOME_DIR -1
733 732
 #define Y_HOME_DIR -1
734 733
 #define Z_HOME_DIR -1
735 734
 
736
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
737
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
738
-
739 735
 // @section machine
740 736
 
741 737
 // Travel limits after homing (units are in mm)
@@ -746,6 +742,11 @@
746 742
 #define Y_MAX_POS 275
747 743
 #define Z_MAX_POS 250
748 744
 
745
+// If enabled, axes won't move below MIN_POS in response to movement commands.
746
+#define MIN_SOFTWARE_ENDSTOPS
747
+// If enabled, axes won't move above MAX_POS in response to movement commands.
748
+#define MAX_SOFTWARE_ENDSTOPS
749
+
749 750
 /**
750 751
  * Filament Runout Sensor
751 752
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -771,9 +772,9 @@
771 772
   #define MESH_INSET 10        // Mesh inset margin on print area
772 773
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
773 774
   #define MESH_NUM_Y_POINTS 3
774
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
775
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
775 776
 
776
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
777
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
777 778
 
778 779
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
779 780
 

+ 9
- 8
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -697,16 +697,12 @@
697 697
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
698 698
                              // Be sure you have this distance over your Z_MAX_POS in case.
699 699
 
700
-// ENDSTOP SETTINGS:
701
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
702
-// :[-1, 1]
700
+// Direction of endstops when homing; 1=MAX, -1=MIN
701
+// :[-1,1]
703 702
 #define X_HOME_DIR 1
704 703
 #define Y_HOME_DIR 1
705 704
 #define Z_HOME_DIR -1
706 705
 
707
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
708
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
709
-
710 706
 // @section machine
711 707
 
712 708
 // Travel limits after homing (units are in mm)
@@ -717,6 +713,11 @@
717 713
 #define Y_MAX_POS 210
718 714
 #define Z_MAX_POS 200
719 715
 
716
+// If enabled, axes won't move below MIN_POS in response to movement commands.
717
+#define MIN_SOFTWARE_ENDSTOPS
718
+// If enabled, axes won't move above MAX_POS in response to movement commands.
719
+#define MAX_SOFTWARE_ENDSTOPS
720
+
720 721
 /**
721 722
  * Filament Runout Sensor
722 723
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -742,9 +743,9 @@
742 743
   #define MESH_INSET 10        // Mesh inset margin on print area
743 744
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
744 745
   #define MESH_NUM_Y_POINTS 3
745
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
746
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
746 747
 
747
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
748
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
748 749
 
749 750
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
750 751
 

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

@@ -705,16 +705,12 @@
705 705
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
706 706
                              // Be sure you have this distance over your Z_MAX_POS in case.
707 707
 
708
-// ENDSTOP SETTINGS:
709
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
710
-// :[-1, 1]
708
+// Direction of endstops when homing; 1=MAX, -1=MIN
709
+// :[-1,1]
711 710
 #define X_HOME_DIR -1
712 711
 #define Y_HOME_DIR -1
713 712
 #define Z_HOME_DIR -1
714 713
 
715
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
716
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
717
-
718 714
 // @section machine
719 715
 
720 716
 // Travel limits after homing (units are in mm)
@@ -725,6 +721,11 @@
725 721
 #define Y_MAX_POS 200
726 722
 #define Z_MAX_POS 200
727 723
 
724
+// If enabled, axes won't move below MIN_POS in response to movement commands.
725
+#define MIN_SOFTWARE_ENDSTOPS
726
+// If enabled, axes won't move above MAX_POS in response to movement commands.
727
+#define MAX_SOFTWARE_ENDSTOPS
728
+
728 729
 /**
729 730
  * Filament Runout Sensor
730 731
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -750,9 +751,9 @@
750 751
   #define MESH_INSET 10        // Mesh inset margin on print area
751 752
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
752 753
   #define MESH_NUM_Y_POINTS 3
753
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
754
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
754 755
 
755
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
756
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
756 757
 
757 758
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
758 759
 

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

@@ -807,16 +807,12 @@
807 807
 #define Z_HOMING_HEIGHT 15   // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
808 808
                              // Be sure you have this distance over your Z_MAX_POS in case.
809 809
 
810
-// ENDSTOP SETTINGS:
811
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
812
-// :[-1, 1]
810
+// Direction of endstops when homing; 1=MAX, -1=MIN
811
+// :[-1,1]
813 812
 #define X_HOME_DIR 1  // deltas always home to max
814 813
 #define Y_HOME_DIR 1
815 814
 #define Z_HOME_DIR 1
816 815
 
817
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
818
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
819
-
820 816
 // @section machine
821 817
 
822 818
 // Travel limits after homing (units are in mm)
@@ -827,6 +823,11 @@
827 823
 #define Y_MAX_POS DELTA_PRINTABLE_RADIUS
828 824
 #define Z_MAX_POS MANUAL_Z_HOME_POS
829 825
 
826
+// If enabled, axes won't move below MIN_POS in response to movement commands.
827
+#define MIN_SOFTWARE_ENDSTOPS
828
+// If enabled, axes won't move above MAX_POS in response to movement commands.
829
+#define MAX_SOFTWARE_ENDSTOPS
830
+
830 831
 /**
831 832
  * Filament Runout Sensor
832 833
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -853,9 +854,9 @@
853 854
   #define MESH_INSET 10        // Mesh inset margin on print area
854 855
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
855 856
   #define MESH_NUM_Y_POINTS 3
856
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
857
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
857 858
 
858
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
859
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
859 860
 
860 861
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
861 862
 

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

@@ -791,16 +791,12 @@
791 791
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
792 792
                              // Be sure you have this distance over your Z_MAX_POS in case.
793 793
 
794
-// ENDSTOP SETTINGS:
795
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
796
-// :[-1, 1]
794
+// Direction of endstops when homing; 1=MAX, -1=MIN
795
+// :[-1,1]
797 796
 #define X_HOME_DIR 1  // deltas always home to max
798 797
 #define Y_HOME_DIR 1
799 798
 #define Z_HOME_DIR 1
800 799
 
801
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
802
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
803
-
804 800
 // @section machine
805 801
 
806 802
 // Travel limits after homing (units are in mm)
@@ -811,6 +807,11 @@
811 807
 #define Y_MAX_POS DELTA_PRINTABLE_RADIUS
812 808
 #define Z_MAX_POS MANUAL_Z_HOME_POS
813 809
 
810
+// If enabled, axes won't move below MIN_POS in response to movement commands.
811
+#define MIN_SOFTWARE_ENDSTOPS
812
+// If enabled, axes won't move above MAX_POS in response to movement commands.
813
+#define MAX_SOFTWARE_ENDSTOPS
814
+
814 815
 /**
815 816
  * Filament Runout Sensor
816 817
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -836,9 +837,9 @@
836 837
   #define MESH_INSET 10        // Mesh inset margin on print area
837 838
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
838 839
   #define MESH_NUM_Y_POINTS 3
839
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
840
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
840 841
 
841
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
842
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
842 843
 
843 844
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
844 845
 

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

@@ -794,16 +794,12 @@
794 794
 //#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
795 795
                              // Be sure you have this distance over your Z_MAX_POS in case.
796 796
 
797
-// ENDSTOP SETTINGS:
798
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
799
-// :[-1, 1]
797
+// Direction of endstops when homing; 1=MAX, -1=MIN
798
+// :[-1,1]
800 799
 #define X_HOME_DIR 1  // deltas always home to max
801 800
 #define Y_HOME_DIR 1
802 801
 #define Z_HOME_DIR 1
803 802
 
804
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
805
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
806
-
807 803
 // @section machine
808 804
 
809 805
 // Travel limits after homing (units are in mm)
@@ -814,6 +810,11 @@
814 810
 #define Y_MAX_POS DELTA_PRINTABLE_RADIUS
815 811
 #define Z_MAX_POS MANUAL_Z_HOME_POS
816 812
 
813
+// If enabled, axes won't move below MIN_POS in response to movement commands.
814
+#define MIN_SOFTWARE_ENDSTOPS
815
+// If enabled, axes won't move above MAX_POS in response to movement commands.
816
+#define MAX_SOFTWARE_ENDSTOPS
817
+
817 818
 /**
818 819
  * Filament Runout Sensor
819 820
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -839,9 +840,9 @@
839 840
   #define MESH_INSET 10        // Mesh inset margin on print area
840 841
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
841 842
   #define MESH_NUM_Y_POINTS 3
842
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
843
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
843 844
 
844
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
845
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
845 846
 
846 847
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
847 848
 

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

@@ -793,16 +793,12 @@
793 793
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
794 794
                              // Be sure you have this distance over your Z_MAX_POS in case.
795 795
 
796
-// ENDSTOP SETTINGS:
797
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
798
-// :[-1, 1]
796
+// Direction of endstops when homing; 1=MAX, -1=MIN
797
+// :[-1,1]
799 798
 #define X_HOME_DIR 1  // deltas always home to max
800 799
 #define Y_HOME_DIR 1
801 800
 #define Z_HOME_DIR 1
802 801
 
803
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
804
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
805
-
806 802
 // @section machine
807 803
 
808 804
 // Travel limits after homing (units are in mm)
@@ -813,6 +809,11 @@
813 809
 #define Y_MAX_POS DELTA_PRINTABLE_RADIUS
814 810
 #define Z_MAX_POS MANUAL_Z_HOME_POS
815 811
 
812
+// If enabled, axes won't move below MIN_POS in response to movement commands.
813
+#define MIN_SOFTWARE_ENDSTOPS
814
+// If enabled, axes won't move above MAX_POS in response to movement commands.
815
+#define MAX_SOFTWARE_ENDSTOPS
816
+
816 817
 /**
817 818
  * Filament Runout Sensor
818 819
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -838,9 +839,9 @@
838 839
   #define MESH_INSET 10        // Mesh inset margin on print area
839 840
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
840 841
   #define MESH_NUM_Y_POINTS 3
841
-  #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
842 843
 
843
-  //#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
844 845
 
845 846
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
846 847
 

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

@@ -797,16 +797,12 @@
797 797
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
798 798
                              // Be sure you have this distance over your Z_MAX_POS in case.
799 799
 
800
-// ENDSTOP SETTINGS:
801
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
802
-// :[-1, 1]
800
+// Direction of endstops when homing; 1=MAX, -1=MIN
801
+// :[-1,1]
803 802
 #define X_HOME_DIR 1  // deltas always home to max
804 803
 #define Y_HOME_DIR 1
805 804
 #define Z_HOME_DIR 1
806 805
 
807
-#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS.
808
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
809
-
810 806
 // @section machine
811 807
 
812 808
 // Travel limits after homing (units are in mm)
@@ -817,6 +813,11 @@
817 813
 #define Y_MAX_POS DELTA_PRINTABLE_RADIUS
818 814
 #define Z_MAX_POS MANUAL_Z_HOME_POS
819 815
 
816
+// If enabled, axes won't move below MIN_POS in response to movement commands.
817
+//#define MIN_SOFTWARE_ENDSTOPS
818
+// If enabled, axes won't move above MAX_POS in response to movement commands.
819
+#define MAX_SOFTWARE_ENDSTOPS
820
+
820 821
 /**
821 822
  * Filament Runout Sensor
822 823
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -842,9 +843,9 @@
842 843
   #define MESH_INSET 10        // Mesh inset margin on print area
843 844
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
844 845
   #define MESH_NUM_Y_POINTS 3
845
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
846
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
846 847
 
847
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
848
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
848 849
 
849 850
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
850 851
 

+ 9
- 8
Marlin/example_configurations/makibox/Configuration.h View File

@@ -708,16 +708,12 @@
708 708
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
709 709
                              // Be sure you have this distance over your Z_MAX_POS in case.
710 710
 
711
-// ENDSTOP SETTINGS:
712
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
713
-// :[-1, 1]
711
+// Direction of endstops when homing; 1=MAX, -1=MIN
712
+// :[-1,1]
714 713
 #define X_HOME_DIR -1
715 714
 #define Y_HOME_DIR -1
716 715
 #define Z_HOME_DIR -1
717 716
 
718
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
719
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
720
-
721 717
 // @section machine
722 718
 
723 719
 // Travel limits after homing (units are in mm)
@@ -728,6 +724,11 @@
728 724
 #define Y_MAX_POS 150
729 725
 #define Z_MAX_POS 86
730 726
 
727
+// If enabled, axes won't move below MIN_POS in response to movement commands.
728
+#define MIN_SOFTWARE_ENDSTOPS
729
+// If enabled, axes won't move above MAX_POS in response to movement commands.
730
+#define MAX_SOFTWARE_ENDSTOPS
731
+
731 732
 /**
732 733
  * Filament Runout Sensor
733 734
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -753,9 +754,9 @@
753 754
   #define MESH_INSET 10        // Mesh inset margin on print area
754 755
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
755 756
   #define MESH_NUM_Y_POINTS 3
756
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
757
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
757 758
 
758
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
759
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
759 760
 
760 761
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
761 762
 

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

@@ -701,16 +701,12 @@
701 701
 //#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
702 702
                              // Be sure you have this distance over your Z_MAX_POS in case.
703 703
 
704
-// ENDSTOP SETTINGS:
705
-// Sets direction of endstops when homing; 1=MAX, -1=MIN
706
-// :[-1, 1]
704
+// Direction of endstops when homing; 1=MAX, -1=MIN
705
+// :[-1,1]
707 706
 #define X_HOME_DIR -1
708 707
 #define Y_HOME_DIR -1
709 708
 #define Z_HOME_DIR -1
710 709
 
711
-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
712
-#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
713
-
714 710
 // @section machine
715 711
 
716 712
 // Travel limits after homing (units are in mm)
@@ -721,6 +717,11 @@
721 717
 #define Y_MAX_POS 205
722 718
 #define Z_MAX_POS 120
723 719
 
720
+// If enabled, axes won't move below MIN_POS in response to movement commands.
721
+#define MIN_SOFTWARE_ENDSTOPS
722
+// If enabled, axes won't move above MAX_POS in response to movement commands.
723
+#define MAX_SOFTWARE_ENDSTOPS
724
+
724 725
 /**
725 726
  * Filament Runout Sensor
726 727
  * A mechanical or opto endstop is used to check for the presence of filament.
@@ -746,9 +747,9 @@
746 747
   #define MESH_INSET 10        // Mesh inset margin on print area
747 748
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
748 749
   #define MESH_NUM_Y_POINTS 3
749
-  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
750
+  #define MANUAL_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment
750 751
 
751
-  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
752
+  //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
752 753
 
753 754
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
754 755
 

+ 19
- 0
Marlin/mesh_bed_leveling.h View File

@@ -23,6 +23,23 @@
23 23
 #include "Marlin.h"
24 24
 
25 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 43
   #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1))
27 44
   #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1))
28 45
 
@@ -44,6 +61,8 @@
44 61
     void set_active(const bool onOff)   { onOff ? SBI(status, MBL_STATUS_ACTIVE_BIT) : CBI(status, MBL_STATUS_ACTIVE_BIT); }
45 62
     bool has_mesh() const               { return TEST(status, MBL_STATUS_HAS_MESH_BIT); }
46 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 67
     inline void zigzag(const int8_t index, int8_t &px, int8_t &py) const {
49 68
       px = index % (MESH_NUM_X_POINTS);

+ 48
- 48
Marlin/ultralcd.cpp View File

@@ -1220,21 +1220,20 @@ void kill_screen(const char* lcd_msg) {
1220 1220
      *
1221 1221
      */
1222 1222
 
1223
-    static uint8_t _lcd_level_bed_position;
1223
+    static uint8_t manual_probe_index;
1224 1224
 
1225 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 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 1232
       current_position[X_AXIS] = LOGICAL_X_POSITION(x);
1234 1233
       current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1235 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 1237
         line_to_current(Z_AXIS);
1239 1238
       #endif
1240 1239
       lcd_synchronize();
@@ -1259,48 +1258,44 @@ void kill_screen(const char* lcd_msg) {
1259 1258
       if (encoderPosition) {
1260 1259
         refresh_cmd_timeout();
1261 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 1263
         line_to_current(Z_AXIS);
1265 1264
         lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
1266 1265
         encoderPosition = 0;
1267 1266
       }
1268 1267
 
1269
-      static bool debounce_click = false;
1270 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(manual_probe_index++, current_position[Z_AXIS]);
1270
+        if (manual_probe_index == (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 1275
             line_to_current(Z_AXIS);
1279 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 1294
 KeepDrawing:
1300 1295
       // Update on first display, then only on updates to Z position
1301 1296
       // Show message above on clicks instead
1302 1297
       if (lcdDrawUpdate) {
1303
-        float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
1298
+        const float v = current_position[Z_AXIS];
1304 1299
         lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
1305 1300
       }
1306 1301
 
@@ -1312,7 +1307,7 @@ KeepDrawing:
1312 1307
     void _lcd_level_bed_moving() {
1313 1308
       if (lcdDrawUpdate) {
1314 1309
         char msg[10];
1315
-        sprintf_P(msg, PSTR("%i / %u"), (int)(_lcd_level_bed_position + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS));
1310
+        sprintf_P(msg, PSTR("%i / %u"), (int)(manual_probe_index + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS));
1316 1311
         lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg);
1317 1312
       }
1318 1313
 
@@ -1326,10 +1321,10 @@ KeepDrawing:
1326 1321
       // Set the menu to display ahead of blocking call
1327 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 1325
       int8_t px, py;
1331
-      mbl.zigzag(_lcd_level_bed_position, px, py);
1332
-      _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
1326
+      mbl.zigzag(manual_probe_index, px, py);
1327
+      _manual_probe_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
1333 1328
 
1334 1329
       // After the blocking function returns, change menus
1335 1330
       lcd_goto_screen(_lcd_level_bed_get_z);
@@ -1342,13 +1337,7 @@ KeepDrawing:
1342 1337
     void _lcd_level_bed_homing_done() {
1343 1338
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
1344 1339
       if (lcd_clicked) {
1345
-        _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]);
1340
+        manual_probe_index = 0;
1352 1341
         lcd_goto_screen(_lcd_level_goto_next_point);
1353 1342
       }
1354 1343
     }
@@ -1607,9 +1596,20 @@ KeepDrawing:
1607 1596
     if (encoderPosition) {
1608 1597
       refresh_cmd_timeout();
1609 1598
 
1610
-      // Limit to software endstops, if enabled
1611
-      float min = (soft_endstops_enabled && min_software_endstops) ? soft_endstop_min[axis] : current_position[axis] - 1000,
1612
-            max = (soft_endstops_enabled && max_software_endstops) ? soft_endstop_max[axis] : current_position[axis] + 1000;
1599
+      float min = current_position[axis] - 1000,
1600
+            max = current_position[axis] + 1000;
1601
+
1602
+      #if HAS_SOFTWARE_ENDSTOPS
1603
+        // Limit to software endstops, if enabled
1604
+        if (soft_endstops_enabled) {
1605
+          #if ENABLED(MIN_SOFTWARE_ENDSTOPS)
1606
+            min = soft_endstop_min[axis];
1607
+          #endif
1608
+          #if ENABLED(MAX_SOFTWARE_ENDSTOPS)
1609
+            max = soft_endstop_max[axis];
1610
+          #endif
1611
+        }
1612
+      #endif
1613 1613
 
1614 1614
       // Get the new position
1615 1615
       current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale;

Loading…
Cancel
Save