Browse Source

Don't split first_move while homing or probing

While homing or probing it might be bad if the stop/trobe triggers during the first part and the second is still in the buffer.
AnHardt 6 years ago
parent
commit
a993c5227d
3 changed files with 7 additions and 2 deletions
  1. 2
    0
      Marlin/src/module/motion.cpp
  2. 4
    2
      Marlin/src/module/planner.cpp
  3. 1
    0
      Marlin/src/module/planner.h

+ 2
- 0
Marlin/src/module/motion.cpp View File

@@ -426,11 +426,13 @@ void bracket_probe_move(const bool before) {
426 426
     saved_feedrate_percentage = feedrate_percentage;
427 427
     feedrate_percentage = 100;
428 428
     gcode.refresh_cmd_timeout();
429
+    planner.split_first_move = false;
429 430
   }
430 431
   else {
431 432
     feedrate_mm_s = saved_feedrate_mm_s;
432 433
     feedrate_percentage = saved_feedrate_percentage;
433 434
     gcode.refresh_cmd_timeout();
435
+    planner.split_first_move = true;
434 436
   }
435 437
 }
436 438
 

+ 4
- 2
Marlin/src/module/planner.cpp View File

@@ -103,6 +103,8 @@ float Planner::max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second
103 103
   uint8_t Planner::last_extruder = 0;     // Respond to extruder change
104 104
 #endif
105 105
 
106
+bool Planner::split_first_move = true;
107
+
106 108
 int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder
107 109
 
108 110
 float Planner::e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
@@ -1444,8 +1446,8 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1444 1446
   if (DEBUGGING(DRYRUN))
1445 1447
     position[E_AXIS] = target[E_AXIS];
1446 1448
 
1447
-  // Always split the first move into one longer and one shorter move
1448
-  if (!blocks_queued()) {
1449
+  // Always split the first move into two (if not homing or probing)
1450
+  if (!blocks_queued() && split_first_move) {
1449 1451
     #define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1
1450 1452
     const int32_t between[XYZE] = { _BETWEEN(X), _BETWEEN(Y), _BETWEEN(Z), _BETWEEN(E) };
1451 1453
     DISABLE_STEPPER_DRIVER_INTERRUPT();

+ 1
- 0
Marlin/src/module/planner.h View File

@@ -165,6 +165,7 @@ class Planner {
165 165
                  travel_acceleration,  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
166 166
                  max_jerk[XYZE],       // The largest speed change requiring no acceleration
167 167
                  min_travel_feedrate_mm_s;
168
+    static bool split_first_move;
168 169
 
169 170
     #if HAS_LEVELING
170 171
       static bool leveling_active;          // Flag that bed leveling is enabled

Loading…
Cancel
Save