Browse Source

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 9 years ago
parent
commit
04fdb4de7d

+ 10
- 8
Marlin/Marlin_main.cpp View File

2847
     saved_feedrate = feedrate;
2847
     saved_feedrate = feedrate;
2848
     feedrate = homing_feedrate[X_AXIS];
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
     current_position[X_AXIS] = x + home_offset[X_AXIS];
2857
     current_position[X_AXIS] = x + home_offset[X_AXIS];
2856
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
2858
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
4010
     if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0)
4012
     if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0)
4011
       do_blocking_move_to_z(Z_start_location);
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
      * OK, do the initial probe to get us close to the bed.
4018
      * OK, do the initial probe to get us close to the bed.
4070
           while (angle < 0.0)     // outside of this range.   It looks like they behave correctly with
4072
           while (angle < 0.0)     // outside of this range.   It looks like they behave correctly with
4071
             angle += 360.0;       // numbers outside of the range, but just to be safe we clamp them.
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
           #if DISABLED(DELTA)
4078
           #if DISABLED(DELTA)
4077
             X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
4079
             X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
4109
        * height. This gets us back to the probe location at the same height that
4111
        * height. This gets us back to the probe location at the same height that
4110
        * we have been running around the circle at.
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
       if (deploy_probe_for_each_reading)
4115
       if (deploy_probe_for_each_reading)
4114
         sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level);
4116
         sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level);
4115
       else {
4117
       else {

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

512
 
512
 
513
 #if ENABLED(MESH_BED_LEVELING)
513
 #if ENABLED(MESH_BED_LEVELING)
514
   #define MESH_MIN_X 10
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
   #define MESH_MIN_Y 10
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
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
518
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
519
   #define MESH_NUM_Y_POINTS 3
519
   #define MESH_NUM_Y_POINTS 3
520
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
520
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
557
   #if ENABLED(AUTO_BED_LEVELING_GRID)
557
   #if ENABLED(AUTO_BED_LEVELING_GRID)
558
 
558
 
559
     #define LEFT_PROBE_BED_POSITION  X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
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
     #define FRONT_PROBE_BED_POSITION Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
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
     #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
564
     #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
565
 
565
 
573
     // A simple cross-product is used to estimate the plane of the bed.
573
     // A simple cross-product is used to estimate the plane of the bed.
574
     #define ABL_PROBE_PT_1_X X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
574
     #define ABL_PROBE_PT_1_X X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
575
     #define ABL_PROBE_PT_1_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
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
     #define ABL_PROBE_PT_2_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
577
     #define ABL_PROBE_PT_2_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER
578
     #define ABL_PROBE_PT_3_X ((X_MIN_POS + X_MAX_POS) / 2)
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
   #endif // AUTO_BED_LEVELING_GRID
581
   #endif // AUTO_BED_LEVELING_GRID
582
 
582
 

+ 6
- 4
Marlin/ultralcd.cpp View File

893
   // Z position will be restored with the final action, a G28
893
   // Z position will be restored with the final action, a G28
894
   inline void _mbl_goto_xy(float x, float y) {
894
   inline void _mbl_goto_xy(float x, float y) {
895
     mbl_wait_for_move = true;
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
     current_position[X_AXIS] = x + home_offset[X_AXIS];
902
     current_position[X_AXIS] = x + home_offset[X_AXIS];
901
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
903
     current_position[Y_AXIS] = y + home_offset[Y_AXIS];
902
     line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
904
     line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);

Loading…
Cancel
Save