Przeglądaj źródła

More extra travel jerk changes

Co-Authored-By: josedpedroso <josedpedroso@users.noreply.github.com>
Scott Lahteine 4 lat temu
rodzic
commit
263a7beeb5
1 zmienionych plików z 19 dodań i 9 usunięć
  1. 19
    9
      Marlin/src/module/planner.cpp

+ 19
- 9
Marlin/src/module/planner.cpp Wyświetl plik

@@ -2390,6 +2390,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2390 2390
     // Start with a safe speed (from which the machine may halt to stop immediately).
2391 2391
     float safe_speed = nominal_speed;
2392 2392
 
2393
+    #ifdef TRAVEL_EXTRA_XYJERK
2394
+      const float extra_xyjerk = (de <= 0) ? TRAVEL_EXTRA_XYJERK : 0;
2395
+    #else
2396
+      constexpr float extra_xyjerk = 0;
2397
+    #endif
2398
+
2393 2399
     uint8_t limited = 0;
2394 2400
     #if HAS_LINEAR_E_JERK
2395 2401
       LOOP_XYZ(i)
@@ -2398,13 +2404,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2398 2404
     #endif
2399 2405
     {
2400 2406
       const float jerk = ABS(current_speed[i]);   // cs : Starting from zero, change in speed for this axis
2401
-
2402
-      float maxj = max_jerk[i];                   // mj : The max jerk setting for this axis
2403
-
2404
-      #ifdef TRAVEL_EXTRA_XYJERK
2405
-        if ((TRAVEL_EXTRA_XYJERK) && !de <= 0 && (i == X_AXIS || i == Y_AXIS))
2406
-          maxj += TRAVEL_EXTRA_XYJERK;            // Extra jerk allowance for travel moves
2407
-      #endif
2407
+                  maxj = (max_jerk[axis]          // mj : The max jerk setting for this axis
2408
+                    #ifdef TRAVEL_EXTRA_XYJERK
2409
+                      + (axis == X_AXIS || axis == Y_AXIS ? extra_xyjerk : 0)
2410
+                    #endif
2411
+                  );
2408 2412
 
2409 2413
       if (jerk > maxj) {                          // cs > mj : New current speed too fast?
2410 2414
         if (limited) {                            // limited already?
@@ -2457,8 +2461,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2457 2461
             : // v_exit <= v_entry                coasting             axis reversal
2458 2462
               ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : _MAX(-v_exit, v_entry) );
2459 2463
 
2460
-        if (jerk > max_jerk[axis]) {
2461
-          v_factor *= max_jerk[axis] / jerk;
2464
+        const float maxj = (max_jerk[axis]
2465
+          #ifdef TRAVEL_EXTRA_XYJERK
2466
+            + (axis == X_AXIS || axis == Y_AXIS ? extra_xyjerk : 0)
2467
+          #endif
2468
+        );
2469
+
2470
+        if (jerk > maxj) {
2471
+          v_factor *= maxj / jerk;
2462 2472
           ++limited;
2463 2473
         }
2464 2474
       }

Ładowanie…
Anuluj
Zapisz