Browse Source

♻️ reset_acceleration_rates => refresh_…

Scott Lahteine 2 years ago
parent
commit
93ffd57383

+ 2
- 2
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -169,7 +169,7 @@
169 169
       motion_state.jerk_state = planner.max_jerk;
170 170
       planner.max_jerk.set(0, 0 OPTARG(DELTA, 0));
171 171
     #endif
172
-    planner.reset_acceleration_rates();
172
+    planner.refresh_acceleration_rates();
173 173
     return motion_state;
174 174
   }
175 175
 
@@ -178,7 +178,7 @@
178 178
     planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = motion_state.acceleration.y;
179 179
     TERN_(DELTA, planner.settings.max_acceleration_mm_per_s2[Z_AXIS] = motion_state.acceleration.z);
180 180
     TERN_(HAS_CLASSIC_JERK, planner.max_jerk = motion_state.jerk_state);
181
-    planner.reset_acceleration_rates();
181
+    planner.refresh_acceleration_rates();
182 182
   }
183 183
 
184 184
 #endif // IMPROVE_HOMING_RELIABILITY

+ 4
- 4
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -483,7 +483,7 @@ void menu_backlash();
483 483
     // M204 T Travel Acceleration
484 484
     EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel);
485 485
 
486
-    #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST_N(long5_25, _AXIS(Q), MSG_AMAX_N, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); })
486
+    #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST_N(long5_25, _AXIS(Q), MSG_AMAX_N, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.refresh_acceleration_rates(); })
487 487
     NUM_AXIS_CODE(
488 488
       EDIT_AMAX(A, 100), EDIT_AMAX(B, 100), EDIT_AMAX(C, 10),
489 489
       EDIT_AMAX(I,  10), EDIT_AMAX(J,  10), EDIT_AMAX(K, 10),
@@ -491,14 +491,14 @@ void menu_backlash();
491 491
     );
492 492
 
493 493
     #if ENABLED(DISTINCT_E_FACTORS)
494
-      EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
494
+      EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.refresh_acceleration_rates(); });
495 495
       LOOP_L_N(n, E_STEPPERS)
496 496
         EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{
497 497
           if (MenuItemBase::itemIndex == active_extruder)
498
-            planner.reset_acceleration_rates();
498
+            planner.refresh_acceleration_rates();
499 499
        });
500 500
     #elif E_STEPPERS
501
-      EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
501
+      EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.refresh_acceleration_rates(); });
502 502
     #endif
503 503
 
504 504
     #ifdef XY_FREQUENCY_LIMIT

+ 5
- 5
Marlin/src/module/planner.cpp View File

@@ -1557,7 +1557,7 @@ void Planner::check_axes_activity() {
1557 1557
       TERN_(DELTA, settings.max_acceleration_mm_per_s2[Z_AXIS] = saved_motion_state.acceleration.z);
1558 1558
       TERN_(HAS_CLASSIC_JERK, max_jerk = saved_motion_state.jerk_state);
1559 1559
     }
1560
-    reset_acceleration_rates();
1560
+    refresh_acceleration_rates();
1561 1561
   }
1562 1562
 
1563 1563
 #endif
@@ -3267,7 +3267,7 @@ void Planner::set_position_mm(const xyze_pos_t &xyze) {
3267 3267
  *          - acceleration_long_cutoff based on the largest max_acceleration_steps_per_s2 (M201)
3268 3268
  *          - max_e_jerk for all extruders based on junction_deviation_mm (M205 J)
3269 3269
  */
3270
-void Planner::reset_acceleration_rates() {
3270
+void Planner::refresh_acceleration_rates() {
3271 3271
   uint32_t highest_rate = 1;
3272 3272
   LOOP_DISTINCT_AXES(i) {
3273 3273
     max_acceleration_steps_per_s2[i] = settings.max_acceleration_mm_per_s2[i] * settings.axis_steps_per_mm[i];
@@ -3285,7 +3285,7 @@ void Planner::reset_acceleration_rates() {
3285 3285
 void Planner::refresh_positioning() {
3286 3286
   LOOP_DISTINCT_AXES(i) mm_per_step[i] = 1.0f / settings.axis_steps_per_mm[i];
3287 3287
   set_position_mm(current_position);
3288
-  reset_acceleration_rates();
3288
+  refresh_acceleration_rates();
3289 3289
 }
3290 3290
 
3291 3291
 // Apply limits to a variable and give a warning if the value was out of range
@@ -3304,7 +3304,7 @@ inline void limit_and_warn(float &val, const AxisEnum axis, PGM_P const setting_
3304 3304
 /**
3305 3305
  * For the specified 'axis' set the Maximum Acceleration to the given value (mm/s^2)
3306 3306
  * The value may be limited with warning feedback, if configured.
3307
- * Calls reset_acceleration_rates to precalculate planner terms in steps.
3307
+ * Calls refresh_acceleration_rates to precalculate planner terms in steps.
3308 3308
  *
3309 3309
  * This hard limit is applied as a block is being added to the planner queue.
3310 3310
  */
@@ -3322,7 +3322,7 @@ void Planner::set_max_acceleration(const AxisEnum axis, float inMaxAccelMMS2) {
3322 3322
   settings.max_acceleration_mm_per_s2[axis] = inMaxAccelMMS2;
3323 3323
 
3324 3324
   // Update steps per s2 to agree with the units per s2 (since they are used in the planner)
3325
-  reset_acceleration_rates();
3325
+  refresh_acceleration_rates();
3326 3326
 }
3327 3327
 
3328 3328
 /**

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

@@ -514,7 +514,7 @@ class Planner {
514 514
      */
515 515
 
516 516
     // Recalculate steps/s^2 accelerations based on mm/s^2 settings
517
-    static void reset_acceleration_rates();
517
+    static void refresh_acceleration_rates();
518 518
 
519 519
     /**
520 520
      * Recalculate 'position' and 'mm_per_step'.

+ 1
- 1
Marlin/src/module/settings.cpp View File

@@ -592,7 +592,7 @@ void MarlinSettings::postprocess() {
592 592
   xyze_pos_t oldpos = current_position;
593 593
 
594 594
   // steps per s2 needs to be updated to agree with units per s2
595
-  planner.reset_acceleration_rates();
595
+  planner.refresh_acceleration_rates();
596 596
 
597 597
   // Make sure delta kinematics are updated before refreshing the
598 598
   // planner position so the stepper counts will be set correctly.

Loading…
Cancel
Save