Explorar el Código

Merge pull request #3524 from thinkyhead/rc_fix_mbl_oopsie_1

Oops! Fix MBL move Z to MESH_HOME_SEARCH_Z between probes
Scott Lahteine hace 9 años
padre
commit
04fdb4de7d

+ 10
- 8
Marlin/Marlin_main.cpp Ver fichero

@@ -2847,10 +2847,12 @@ inline void gcode_G28() {
2847 2847
     saved_feedrate = feedrate;
2848 2848
     feedrate = homing_feedrate[X_AXIS];
2849 2849
 
2850
-    #if MIN_Z_HEIGHT_FOR_HOMING > 0
2851
-      current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING;
2852
-      line_to_current_position();
2853
-    #endif
2850
+    current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
2851
+      #if MIN_Z_HEIGHT_FOR_HOMING > 0
2852
+        + MIN_Z_HEIGHT_FOR_HOMING
2853
+      #endif
2854
+    ;
2855
+    line_to_current_position();
2854 2856
 
2855 2857
     current_position[X_AXIS] = x + home_offset[X_AXIS];
2856 2858
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
@@ -4010,7 +4012,7 @@ inline void gcode_M42() {
4010 4012
     if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0)
4011 4013
       do_blocking_move_to_z(Z_start_location);
4012 4014
 
4013
-    do_blocking_move_to_xy(X_probe_location - X_PROBE_OFFSET_FROM_EXTRUDER, Y_probe_location - Y_PROBE_OFFSET_FROM_EXTRUDER);
4015
+    do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
4014 4016
 
4015 4017
     /**
4016 4018
      * OK, do the initial probe to get us close to the bed.
@@ -4070,8 +4072,8 @@ inline void gcode_M42() {
4070 4072
           while (angle < 0.0)     // outside of this range.   It looks like they behave correctly with
4071 4073
             angle += 360.0;       // numbers outside of the range, but just to be safe we clamp them.
4072 4074
 
4073
-          X_current = X_probe_location - X_PROBE_OFFSET_FROM_EXTRUDER + cos(RADIANS(angle)) * radius;
4074
-          Y_current = Y_probe_location - Y_PROBE_OFFSET_FROM_EXTRUDER + sin(RADIANS(angle)) * radius;
4075
+          X_current = X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER) + cos(RADIANS(angle)) * radius;
4076
+          Y_current = Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER) + sin(RADIANS(angle)) * radius;
4075 4077
 
4076 4078
           #if DISABLED(DELTA)
4077 4079
             X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
@@ -4109,7 +4111,7 @@ inline void gcode_M42() {
4109 4111
        * height. This gets us back to the probe location at the same height that
4110 4112
        * we have been running around the circle at.
4111 4113
        */
4112
-      do_blocking_move_to_xy(X_probe_location - X_PROBE_OFFSET_FROM_EXTRUDER, Y_probe_location - Y_PROBE_OFFSET_FROM_EXTRUDER);
4114
+      do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
4113 4115
       if (deploy_probe_for_each_reading)
4114 4116
         sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level);
4115 4117
       else {

+ 6
- 6
Marlin/example_configurations/Hephestos_2/Configuration.h Ver fichero

@@ -512,9 +512,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
512 512
 
513 513
 #if ENABLED(MESH_BED_LEVELING)
514 514
   #define MESH_MIN_X 10
515
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
515
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
516 516
   #define MESH_MIN_Y 10
517
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
517
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
518 518
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
519 519
   #define MESH_NUM_Y_POINTS 3
520 520
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
@@ -557,9 +557,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
557 557
   #if ENABLED(AUTO_BED_LEVELING_GRID)
558 558
 
559 559
     #define LEFT_PROBE_BED_POSITION  X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
560
-    #define RIGHT_PROBE_BED_POSITION X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER
560
+    #define RIGHT_PROBE_BED_POSITION X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
561 561
     #define FRONT_PROBE_BED_POSITION Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
562
-    #define BACK_PROBE_BED_POSITION  Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER
562
+    #define BACK_PROBE_BED_POSITION  Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
563 563
 
564 564
     #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
565 565
 
@@ -573,10 +573,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
573 573
     // A simple cross-product is used to estimate the plane of the bed.
574 574
     #define ABL_PROBE_PT_1_X X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
575 575
     #define ABL_PROBE_PT_1_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
576
-    #define ABL_PROBE_PT_2_X X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER
576
+    #define ABL_PROBE_PT_2_X X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
577 577
     #define ABL_PROBE_PT_2_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
578 578
     #define ABL_PROBE_PT_3_X ((X_MIN_POS + X_MAX_POS) / 2)
579
-    #define ABL_PROBE_PT_3_Y Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER
579
+    #define ABL_PROBE_PT_3_Y Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
580 580
 
581 581
   #endif // AUTO_BED_LEVELING_GRID
582 582
 

+ 6
- 4
Marlin/ultralcd.cpp Ver fichero

@@ -893,10 +893,12 @@ void lcd_cooldown() {
893 893
   // Z position will be restored with the final action, a G28
894 894
   inline void _mbl_goto_xy(float x, float y) {
895 895
     mbl_wait_for_move = true;
896
-    #if MIN_Z_HEIGHT_FOR_HOMING > 0
897
-      current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING;
898
-      line_to_current(Z_AXIS);
899
-    #endif
896
+    current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
897
+      #if MIN_Z_HEIGHT_FOR_HOMING > 0
898
+        + MIN_Z_HEIGHT_FOR_HOMING
899
+      #endif
900
+    ;
901
+    line_to_current(Z_AXIS);
900 902
     current_position[X_AXIS] = x + home_offset[X_AXIS];
901 903
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
902 904
     line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);

Loading…
Cancelar
Guardar