Browse Source

Add speed configuration for home-bumping movement

alexborro 9 years ago
parent
commit
60ceca1bc1

+ 7
- 2
Marlin/Configuration.h View File

@@ -407,6 +407,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
407 407
     #define RIGHT_PROBE_BED_POSITION 170
408 408
     #define FRONT_PROBE_BED_POSITION 20
409 409
     #define BACK_PROBE_BED_POSITION 170
410
+    
411
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
410 412
 
411 413
     // Set the number of grid points per dimension
412 414
     // You probably don't need more than 3 (squared=9)
@@ -429,8 +431,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
429 431
 
430 432
   // Offsets to the probe relative to the extruder tip (Hotend - Probe)
431 433
   // X and Y offsets must be integers
432
-  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // -left  +right
433
-  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // -front +behind
434
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // Probe on: -left  +right
435
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // Probe on: -front +behind
434 436
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35  // -below (always!)
435 437
 
436 438
   #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
@@ -441,6 +443,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
441 443
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
442 444
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
443 445
 
446
+   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
447
+                                                                            //Useful to retract a deployable probe.
448
+                                                                           
444 449
   //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
445 450
   //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
446 451
 

+ 1
- 0
Marlin/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 2
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

+ 40
- 26
Marlin/Marlin_main.cpp View File

@@ -201,6 +201,7 @@
201 201
 #endif
202 202
 
203 203
 float homing_feedrate[] = HOMING_FEEDRATE;
204
+int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
204 205
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
205 206
 int feedmultiply = 100; //100->1 200->2
206 207
 int saved_feedmultiply;
@@ -1131,7 +1132,18 @@ static void run_z_probe() {
1131 1132
     st_synchronize();
1132 1133
 
1133 1134
     // move back down slowly to find bed
1134
-    feedrate = homing_feedrate[Z_AXIS]/4;
1135
+    
1136
+    if (homing_bump_divisor[Z_AXIS] >= 1)
1137
+    {
1138
+        feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS];
1139
+    } 
1140
+    else
1141
+    {
1142
+        feedrate = homing_feedrate[Z_AXIS]/10;
1143
+        SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1");
1144
+    }
1145
+
1146
+    
1135 1147
     zPosition -= home_retract_mm(Z_AXIS) * 2;
1136 1148
     plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
1137 1149
     st_synchronize();
@@ -1293,11 +1305,17 @@ static void homeaxis(int axis) {
1293 1305
     st_synchronize();
1294 1306
 
1295 1307
     destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
1296
-#ifdef DELTA
1297
-    feedrate = homing_feedrate[axis]/10;
1298
-#else
1299
-    feedrate = homing_feedrate[axis]/2 ;
1300
-#endif
1308
+
1309
+    if (homing_bump_divisor[axis] >= 1)
1310
+    {
1311
+        feedrate = homing_feedrate[axis]/homing_bump_divisor[axis];
1312
+    } 
1313
+    else
1314
+    {
1315
+        feedrate = homing_feedrate[axis]/10;
1316
+        SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1");
1317
+    }
1318
+
1301 1319
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
1302 1320
     st_synchronize();
1303 1321
 #ifdef DELTA
@@ -1756,41 +1774,32 @@ inline void gcode_G28() {
1756 1774
 
1757 1775
   #ifdef AUTO_BED_LEVELING_GRID
1758 1776
 
1759
-    #define MIN_PROBE_EDGE 20 // The probe square sides can be no smaller than this
1760
-
1761 1777
     // Make sure probing points are reachable
1762 1778
 
1763 1779
     #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
1764
-      #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe.
1780
+      #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
1765 1781
     #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
1766
-      #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe.
1782
+      #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
1767 1783
     #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
1768
-      #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe.
1784
+      #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
1769 1785
     #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
1770
-      #error The given BACK_PROBE_BED_POSITION can't be reached by the probe.
1771
-
1772
-    // Check if Probe_Offset * Grid Points is greater than Probing Range
1773
-
1774
-    #elif abs(X_PROBE_OFFSET_FROM_EXTRUDER) * (AUTO_BED_LEVELING_GRID_POINTS-1) >= RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION
1775
-      #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
1776
-    #elif abs(Y_PROBE_OFFSET_FROM_EXTRUDER) * (AUTO_BED_LEVELING_GRID_POINTS-1) >= BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION
1777
-      #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
1786
+      #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
1778 1787
     #endif
1779 1788
 
1780 1789
   #else // !AUTO_BED_LEVELING_GRID
1781 1790
 
1782 1791
     #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
1783
-      #error The given ABL_PROBE_PT_1_X can't be reached by the probe.
1792
+      #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
1784 1793
     #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
1785
-      #error The given ABL_PROBE_PT_2_X can't be reached by the probe.
1794
+      #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
1786 1795
     #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
1787
-      #error The given ABL_PROBE_PT_3_X can't be reached by the probe.
1796
+      #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
1788 1797
     #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
1789
-      #error The given ABL_PROBE_PT_1_Y can't be reached by the probe.
1798
+      #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
1790 1799
     #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
1791
-      #error The given ABL_PROBE_PT_2_Y can't be reached by the probe.
1800
+      #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
1792 1801
     #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
1793
-      #error The given ABL_PROBE_PT_3_Y can't be reached by the probe.
1802
+      #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
1794 1803
     #endif
1795 1804
 
1796 1805
   #endif // !AUTO_BED_LEVELING_GRID
@@ -1862,7 +1871,7 @@ inline void gcode_G28() {
1862 1871
         SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n");
1863 1872
 
1864 1873
       int auto_bed_leveling_grid_points = code_seen('P') ? code_value_long() : AUTO_BED_LEVELING_GRID_POINTS;
1865
-      if (auto_bed_leveling_grid_points < 2 || auto_bed_leveling_grid_points > AUTO_BED_LEVELING_GRID_POINTS) {
1874
+      if (auto_bed_leveling_grid_points < 2) {
1866 1875
         SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
1867 1876
         return;
1868 1877
       }
@@ -2095,6 +2104,11 @@ inline void gcode_G28() {
2095 2104
     #ifdef Z_PROBE_SLED
2096 2105
       dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
2097 2106
     #endif
2107
+    
2108
+    #ifdef Z_PROBE_END_SCRIPT
2109
+      enquecommands_P(PSTR(Z_PROBE_END_SCRIPT));
2110
+      st_synchronize();
2111
+    #endif
2098 2112
   }
2099 2113
 
2100 2114
   #ifndef Z_PROBE_SLED

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

@@ -413,6 +413,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
413 413
     #define RIGHT_PROBE_BED_POSITION 170
414 414
     #define FRONT_PROBE_BED_POSITION 20
415 415
     #define BACK_PROBE_BED_POSITION 170
416
+    
417
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
416 418
 
417 419
     // Set the number of grid points per dimension
418 420
     // You probably don't need more than 3 (squared=9)

+ 1
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 2
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

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

@@ -419,6 +419,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
419 419
     #define FRONT_PROBE_BED_POSITION 20
420 420
     #define BACK_PROBE_BED_POSITION 170
421 421
 
422
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this    
423
+    
422 424
     // Set the number of grid points per dimension
423 425
     // You probably don't need more than 3 (squared=9)
424 426
     #define AUTO_BED_LEVELING_GRID_POINTS 2

+ 1
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 3
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

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

@@ -443,6 +443,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
443 443
     #define FRONT_PROBE_BED_POSITION 20
444 444
     #define BACK_PROBE_BED_POSITION 170
445 445
 
446
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this    
447
+    
446 448
     // Set the number of grid points per dimension
447 449
     // You probably don't need more than 3 (squared=9)
448 450
     #define AUTO_BED_LEVELING_GRID_POINTS 2

+ 1
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 3
215 215
 #define Y_HOME_RETRACT_MM 3
216 216
 #define Z_HOME_RETRACT_MM 3
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 #ifdef SCARA
219 220
 	#define QUICK_HOME //SCARA needs Quickhome

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

@@ -413,6 +413,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
413 413
     #define FRONT_PROBE_BED_POSITION 20
414 414
     #define BACK_PROBE_BED_POSITION 170
415 415
 
416
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
417
+    
416 418
     // Set the number of grid points per dimension
417 419
     // You probably don't need more than 3 (squared=9)
418 420
     #define AUTO_BED_LEVELING_GRID_POINTS 2

+ 1
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 2
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

+ 1
- 0
Marlin/example_configurations/delta/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5 
215 215
 #define Y_HOME_RETRACT_MM 5 
216 216
 #define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 
218 219
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219 220
 

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

@@ -411,6 +411,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
411 411
     #define FRONT_PROBE_BED_POSITION 20
412 412
     #define BACK_PROBE_BED_POSITION 170
413 413
 
414
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this    
415
+    
414 416
     // Set the number of grid points per dimension
415 417
     // You probably don't need more than 3 (squared=9)
416 418
     #define AUTO_BED_LEVELING_GRID_POINTS 2

+ 1
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 2
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

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

@@ -412,6 +412,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
412 412
     #define RIGHT_PROBE_BED_POSITION 170
413 413
     #define FRONT_PROBE_BED_POSITION 20
414 414
     #define BACK_PROBE_BED_POSITION 170
415
+    
416
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this    
415 417
 
416 418
     // Set the number of grid points per dimension
417 419
     // You probably don't need more than 3 (squared=9)

+ 1
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -214,6 +214,7 @@
214 214
 #define X_HOME_RETRACT_MM 5
215 215
 #define Y_HOME_RETRACT_MM 5
216 216
 #define Z_HOME_RETRACT_MM 1
217
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
217 218
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
218 219
 
219 220
 #define AXIS_RELATIVE_MODES {false, false, false, false}

Loading…
Cancel
Save