瀏覽代碼

Merge pull request #6764 from thinkyhead/bf_cleanups_tuesday

Prevent home_all_axes picking up XYZ parameters from command
Scott Lahteine 8 年之前
父節點
當前提交
455a24f6ff

+ 1
- 1
Marlin/Conditionals_post.h 查看文件

834
       #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS
834
       #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS
835
     #endif
835
     #endif
836
   #endif
836
   #endif
837
-    
837
+
838
   // Shorthand
838
   // Shorthand
839
   #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
839
   #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
840
 
840
 

+ 16
- 14
Marlin/Marlin_main.cpp 查看文件

3713
  *  Z   Home to the Z endstop
3713
  *  Z   Home to the Z endstop
3714
  *
3714
  *
3715
  */
3715
  */
3716
-inline void gcode_G28() {
3716
+inline void gcode_G28(const bool always_home_all) {
3717
 
3717
 
3718
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3718
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3719
     if (DEBUGGING(LEVELING)) {
3719
     if (DEBUGGING(LEVELING)) {
3760
 
3760
 
3761
   #else // NOT DELTA
3761
   #else // NOT DELTA
3762
 
3762
 
3763
-    const bool homeX = code_seen('X'), homeY = code_seen('Y'), homeZ = code_seen('Z'),
3764
-               home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
3763
+    const bool homeX = always_home_all || code_seen('X'),
3764
+               homeY = always_home_all || code_seen('Y'),
3765
+               homeZ = always_home_all || code_seen('Z'),
3766
+               home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
3765
 
3767
 
3766
     set_destination_to_current();
3768
     set_destination_to_current();
3767
 
3769
 
3768
     #if Z_HOME_DIR > 0  // If homing away from BED do Z first
3770
     #if Z_HOME_DIR > 0  // If homing away from BED do Z first
3769
 
3771
 
3770
-      if (home_all_axis || homeZ) {
3772
+      if (home_all || homeZ) {
3771
         HOMEAXIS(Z);
3773
         HOMEAXIS(Z);
3772
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3774
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3773
           if (DEBUGGING(LEVELING)) DEBUG_POS("> HOMEAXIS(Z)", current_position);
3775
           if (DEBUGGING(LEVELING)) DEBUG_POS("> HOMEAXIS(Z)", current_position);
3776
 
3778
 
3777
     #else
3779
     #else
3778
 
3780
 
3779
-      if (home_all_axis || homeX || homeY) {
3781
+      if (home_all || homeX || homeY) {
3780
         // Raise Z before homing any other axes and z is not already high enough (never lower z)
3782
         // Raise Z before homing any other axes and z is not already high enough (never lower z)
3781
         destination[Z_AXIS] = LOGICAL_Z_POSITION(Z_HOMING_HEIGHT);
3783
         destination[Z_AXIS] = LOGICAL_Z_POSITION(Z_HOMING_HEIGHT);
3782
         if (destination[Z_AXIS] > current_position[Z_AXIS]) {
3784
         if (destination[Z_AXIS] > current_position[Z_AXIS]) {
3794
 
3796
 
3795
     #if ENABLED(QUICK_HOME)
3797
     #if ENABLED(QUICK_HOME)
3796
 
3798
 
3797
-      if (home_all_axis || (homeX && homeY)) quick_home_xy();
3799
+      if (home_all || (homeX && homeY)) quick_home_xy();
3798
 
3800
 
3799
     #endif
3801
     #endif
3800
 
3802
 
3801
     #if ENABLED(HOME_Y_BEFORE_X)
3803
     #if ENABLED(HOME_Y_BEFORE_X)
3802
 
3804
 
3803
       // Home Y
3805
       // Home Y
3804
-      if (home_all_axis || homeY) {
3806
+      if (home_all || homeY) {
3805
         HOMEAXIS(Y);
3807
         HOMEAXIS(Y);
3806
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3808
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3807
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
3809
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
3811
     #endif
3813
     #endif
3812
 
3814
 
3813
     // Home X
3815
     // Home X
3814
-    if (home_all_axis || homeX) {
3816
+    if (home_all || homeX) {
3815
 
3817
 
3816
       #if ENABLED(DUAL_X_CARRIAGE)
3818
       #if ENABLED(DUAL_X_CARRIAGE)
3817
 
3819
 
3844
 
3846
 
3845
     #if DISABLED(HOME_Y_BEFORE_X)
3847
     #if DISABLED(HOME_Y_BEFORE_X)
3846
       // Home Y
3848
       // Home Y
3847
-      if (home_all_axis || homeY) {
3849
+      if (home_all || homeY) {
3848
         HOMEAXIS(Y);
3850
         HOMEAXIS(Y);
3849
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3851
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3850
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
3852
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
3854
 
3856
 
3855
     // Home Z last if homing towards the bed
3857
     // Home Z last if homing towards the bed
3856
     #if Z_HOME_DIR < 0
3858
     #if Z_HOME_DIR < 0
3857
-      if (home_all_axis || homeZ) {
3859
+      if (home_all || homeZ) {
3858
         #if ENABLED(Z_SAFE_HOMING)
3860
         #if ENABLED(Z_SAFE_HOMING)
3859
           home_z_safely();
3861
           home_z_safely();
3860
         #else
3862
         #else
3861
           HOMEAXIS(Z);
3863
           HOMEAXIS(Z);
3862
         #endif
3864
         #endif
3863
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3865
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3864
-          if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all_axis || homeZ) > final", current_position);
3866
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all || homeZ) > final", current_position);
3865
         #endif
3867
         #endif
3866
-      } // home_all_axis || homeZ
3868
+      } // home_all || homeZ
3867
     #endif // Z_HOME_DIR < 0
3869
     #endif // Z_HOME_DIR < 0
3868
 
3870
 
3869
     SYNC_PLAN_POSITION_KINEMATIC();
3871
     SYNC_PLAN_POSITION_KINEMATIC();
3895
   #endif
3897
   #endif
3896
 } // G28
3898
 } // G28
3897
 
3899
 
3898
-void home_all_axes() { gcode_G28(); }
3900
+void home_all_axes() { gcode_G28(true); }
3899
 
3901
 
3900
 #if HAS_PROBING_PROCEDURE
3902
 #if HAS_PROBING_PROCEDURE
3901
 
3903
 
9858
       #endif // NOZZLE_PARK_FEATURE
9860
       #endif // NOZZLE_PARK_FEATURE
9859
 
9861
 
9860
       case 28: // G28: Home all axes, one at a time
9862
       case 28: // G28: Home all axes, one at a time
9861
-        gcode_G28();
9863
+        gcode_G28(false);
9862
         break;
9864
         break;
9863
 
9865
 
9864
       #if HAS_LEVELING
9866
       #if HAS_LEVELING

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration.h 查看文件

922
   // at which point movement will be level to the machine's XY plane.
922
   // at which point movement will be level to the machine's XY plane.
923
   // The height can be set with M420 Z<height>
923
   // The height can be set with M420 Z<height>
924
   //#define ENABLE_LEVELING_FADE_HEIGHT
924
   //#define ENABLE_LEVELING_FADE_HEIGHT
925
-  
925
+
926
   // Set the boundaries for probing (where the probe can reach).
926
   // Set the boundaries for probing (where the probe can reach).
927
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
927
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
928
-         
928
+
929
 #endif
929
 #endif
930
 
930
 
931
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
931
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h 查看文件

920
   // at which point movement will be level to the machine's XY plane.
920
   // at which point movement will be level to the machine's XY plane.
921
   // The height can be set with M420 Z<height>
921
   // The height can be set with M420 Z<height>
922
   //#define ENABLE_LEVELING_FADE_HEIGHT
922
   //#define ENABLE_LEVELING_FADE_HEIGHT
923
-  
923
+
924
   // Set the boundaries for probing (where the probe can reach).
924
   // Set the boundaries for probing (where the probe can reach).
925
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
925
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
926
-         
926
+
927
 #endif
927
 #endif
928
 
928
 
929
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
929
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)

+ 2
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration.h 查看文件

926
   // at which point movement will be level to the machine's XY plane.
926
   // at which point movement will be level to the machine's XY plane.
927
   // The height can be set with M420 Z<height>
927
   // The height can be set with M420 Z<height>
928
   //#define ENABLE_LEVELING_FADE_HEIGHT
928
   //#define ENABLE_LEVELING_FADE_HEIGHT
929
-  
929
+
930
   // Set the boundaries for probing (where the probe can reach).
930
   // Set the boundaries for probing (where the probe can reach).
931
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
931
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
932
-         
932
+
933
 #endif
933
 #endif
934
 
934
 
935
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
935
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)

+ 2
- 2
Marlin/example_configurations/delta/kossel_xl/Configuration.h 查看文件

989
   // at which point movement will be level to the machine's XY plane.
989
   // at which point movement will be level to the machine's XY plane.
990
   // The height can be set with M420 Z<height>
990
   // The height can be set with M420 Z<height>
991
   //#define ENABLE_LEVELING_FADE_HEIGHT
991
   //#define ENABLE_LEVELING_FADE_HEIGHT
992
-  
992
+
993
   // Set the boundaries for probing (where the probe can reach).
993
   // Set the boundaries for probing (where the probe can reach).
994
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
994
   #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
995
-         
995
+
996
 #endif
996
 #endif
997
 
997
 
998
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
998
 #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)

+ 8
- 18
Marlin/ubl_G29.cpp 查看文件

322
 
322
 
323
     // Check for commands that require the printer to be homed.
323
     // Check for commands that require the printer to be homed.
324
     if (axis_unhomed_error()) {
324
     if (axis_unhomed_error()) {
325
-      if (code_seen('J')) 
325
+      if (code_seen('J'))
326
         home_all_axes();
326
         home_all_axes();
327
-      else
328
-        if (code_seen('P')) {
329
-          int p_val;
330
-	  if (code_has_value()) {
331
-            p_val = code_value_int();
332
-	    if ( p_val==1 || p_val==2 || p_val==4 )
333
-              home_all_axes();
334
-	  }
327
+      else if (code_seen('P')) {
328
+        if (code_has_value()) {
329
+          const int p_val = code_value_int();
330
+          if (p_val == 1 || p_val == 2 || p_val == 4)
331
+            home_all_axes();
335
         }
332
         }
333
+      }
336
     }
334
     }
337
 
335
 
338
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
336
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
1341
           // Also for round beds, there are grid points outside the bed that nozzle can't reach.
1339
           // Also for round beds, there are grid points outside the bed that nozzle can't reach.
1342
           // Prune them from the list and ignore them till the next Phase (manual nozzle probing).
1340
           // Prune them from the list and ignore them till the next Phase (manual nozzle probing).
1343
 
1341
 
1344
-//        if ((probe_as_reference && position_is_reachable_by_probe_raw_xy(mx, my)) || position_is_reachable_raw_xy(mx, my))
1345
-//          continue;
1346
-//
1347
-//        THE ABOVE CODE IS NOT A REPLACEMENT FOR THE CODE BELOW!!!!!!!
1348
-//
1349
-          bool reachable = probe_as_reference ?
1350
-                             position_is_reachable_by_probe_raw_xy( mx, my ) :
1351
-                             position_is_reachable_raw_xy( mx, my );
1352
-          if ( ! reachable )
1342
+          if ( ! (probe_as_reference ? position_is_reachable_by_probe_raw_xy(mx, my) : position_is_reachable_raw_xy(mx, my)) )
1353
             continue;
1343
             continue;
1354
 
1344
 
1355
           // Reachable. Check if it's the closest location to the nozzle.
1345
           // Reachable. Check if it's the closest location to the nozzle.

+ 2
- 2
Marlin/ubl_motion.cpp 查看文件

632
                     z_cxyd = z_cxy1 - z_cxy0;                 // z height difference along cx from y0 to y1
632
                     z_cxyd = z_cxy1 - z_cxy0;                 // z height difference along cx from y0 to y1
633
 
633
 
634
               float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST));  // z slope per y along cx from y0 to y1
634
               float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST));  // z slope per y along cx from y0 to y1
635
-        
635
+
636
         //    float z_cxcy = z_cxy0 + z_cxym * cy;            // interpolated mesh z height along cx at cy (do inside the segment loop)
636
         //    float z_cxcy = z_cxy0 + z_cxym * cy;            // interpolated mesh z height along cx at cy (do inside the segment loop)
637
 
637
 
638
         // As subsequent segments step through this cell, the z_cxy0 intercept will change
638
         // As subsequent segments step through this cell, the z_cxy0 intercept will change
649
           #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
649
           #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
650
             z_cxcy *= fade_scaling_factor;          // apply fade factor to interpolated mesh height
650
             z_cxcy *= fade_scaling_factor;          // apply fade factor to interpolated mesh height
651
           #endif
651
           #endif
652
-        
652
+
653
           z_cxcy += ubl.state.z_offset;             // add fixed mesh offset from G29 Z
653
           z_cxcy += ubl.state.z_offset;             // add fixed mesh offset from G29 Z
654
 
654
 
655
           if (--segments == 0) {                    // if this is last segment, use ltarget for exact
655
           if (--segments == 0) {                    // if this is last segment, use ltarget for exact

Loading…
取消
儲存