Browse Source

Append units to feedrate variables

Scott Lahteine 8 years ago
parent
commit
93ba5bddd7

+ 12
- 2
Marlin/Marlin.h View File

@@ -296,8 +296,18 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
296 296
   #define CRITICAL_SECTION_END    SREG = _sreg;
297 297
 #endif
298 298
 
299
+/**
300
+ * Feedrate scaling and conversion
301
+ */
302
+extern int feedrate_percentage;
303
+
304
+#define MMM_TO_MMS(MM_M) ((MM_M)/60.0)
305
+#define MMS_TO_MMM(MM_S) ((MM_S)*60.0)
306
+#define MMM_SCALED(MM_M) ((MM_M)*feedrate_percentage/100.0)
307
+#define MMS_SCALED(MM_S) MMM_SCALED(MM_S)
308
+#define MMM_TO_MMS_SCALED(MM_M) (MMS_SCALED(MMM_TO_MMS(MM_M)))
309
+
299 310
 extern bool axis_relative_modes[];
300
-extern int feedrate_multiplier;
301 311
 extern bool volumetric_enabled;
302 312
 extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
303 313
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
@@ -385,7 +395,7 @@ float code_value_temp_diff();
385 395
   extern bool autoretract_enabled;
386 396
   extern bool retracted[EXTRUDERS]; // extruder[n].retracted
387 397
   extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift;
388
-  extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
398
+  extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate_mm_s;
389 399
 #endif
390 400
 
391 401
 // Print job timer

+ 101
- 98
Marlin/Marlin_main.cpp View File

@@ -280,7 +280,6 @@ bool Running = true;
280 280
 
281 281
 uint8_t marlin_debug_flags = DEBUG_NONE;
282 282
 
283
-static float feedrate = 1500.0, saved_feedrate;
284 283
 float current_position[NUM_AXIS] = { 0.0 };
285 284
 static float destination[NUM_AXIS] = { 0.0 };
286 285
 bool axis_known_position[3] = { false };
@@ -302,11 +301,15 @@ static uint8_t cmd_queue_index_r = 0,
302 301
   TempUnit input_temp_units = TEMPUNIT_C;
303 302
 #endif
304 303
 
305
-const float homing_feedrate[] = HOMING_FEEDRATE;
304
+/**
305
+ * Feed rates are often configured with mm/m
306
+ * but the planner and stepper like mm/s units.
307
+ */
308
+const float homing_feedrate_mm_m[] = HOMING_FEEDRATE;
309
+static float feedrate_mm_m = 1500.0, saved_feedrate_mm_m;
310
+int feedrate_percentage = 100, saved_feedrate_percentage;
306 311
 
307 312
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
308
-int feedrate_multiplier = 100; //100->1 200->2
309
-int saved_feedrate_multiplier;
310 313
 int extruder_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
311 314
 bool volumetric_enabled = false;
312 315
 float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA);
@@ -382,16 +385,16 @@ static uint8_t target_extruder;
382 385
   float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
383 386
 #endif
384 387
 
385
-#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]))
388
+#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
386 389
 
387 390
 #if ENABLED(AUTO_BED_LEVELING_FEATURE)
388
-  int xy_probe_speed = XY_PROBE_SPEED;
391
+  int xy_probe_feedrate_mm_m = XY_PROBE_SPEED;
389 392
   bool bed_leveling_in_progress = false;
390
-  #define XY_PROBE_FEEDRATE xy_probe_speed
393
+  #define XY_PROBE_FEEDRATE_MM_M xy_probe_feedrate_mm_m
391 394
 #elif defined(XY_PROBE_SPEED)
392
-  #define XY_PROBE_FEEDRATE XY_PROBE_SPEED
395
+  #define XY_PROBE_FEEDRATE_MM_M XY_PROBE_SPEED
393 396
 #else
394
-  #define XY_PROBE_FEEDRATE (PLANNER_XY_FEEDRATE() * 60)
397
+  #define XY_PROBE_FEEDRATE_MM_M MMS_TO_MMM(PLANNER_XY_FEEDRATE())
395 398
 #endif
396 399
 
397 400
 #if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA)
@@ -430,7 +433,7 @@ static uint8_t target_extruder;
430 433
   float retract_zlift = RETRACT_ZLIFT;
431 434
   float retract_recover_length = RETRACT_RECOVER_LENGTH;
432 435
   float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
433
-  float retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
436
+  float retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
434 437
 
435 438
 #endif // FWRETRACT
436 439
 
@@ -1598,7 +1601,7 @@ inline void set_homing_bump_feedrate(AxisEnum axis) {
1598 1601
     SERIAL_ECHO_START;
1599 1602
     SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1");
1600 1603
   }
1601
-  feedrate = homing_feedrate[axis] / hbd;
1604
+  feedrate_mm_m = homing_feedrate_mm_m[axis] / hbd;
1602 1605
 }
1603 1606
 //
1604 1607
 // line_to_current_position
@@ -1606,19 +1609,19 @@ inline void set_homing_bump_feedrate(AxisEnum axis) {
1606 1609
 // (or from wherever it has been told it is located).
1607 1610
 //
1608 1611
 inline void line_to_current_position() {
1609
-  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate / 60, active_extruder);
1612
+  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder);
1610 1613
 }
1611 1614
 inline void line_to_z(float zPosition) {
1612
-  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate / 60, active_extruder);
1615
+  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder);
1613 1616
 }
1614 1617
 //
1615 1618
 // line_to_destination
1616 1619
 // Move the planner, not necessarily synced with current_position
1617 1620
 //
1618
-inline void line_to_destination(float mm_m) {
1619
-  planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m / 60, active_extruder);
1621
+inline void line_to_destination(float fr_mm_m) {
1622
+  planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);
1620 1623
 }
1621
-inline void line_to_destination() { line_to_destination(feedrate); }
1624
+inline void line_to_destination() { line_to_destination(feedrate_mm_m); }
1622 1625
 
1623 1626
 /**
1624 1627
  * sync_plan_position
@@ -1646,7 +1649,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
1646 1649
     #endif
1647 1650
     refresh_cmd_timeout();
1648 1651
     calculate_delta(destination);
1649
-    planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
1652
+    planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder);
1650 1653
     set_current_to_destination();
1651 1654
   }
1652 1655
 #endif
@@ -1655,8 +1658,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
1655 1658
  *  Plan a move to (X, Y, Z) and set the current_position
1656 1659
  *  The final current_position may not be the one that was requested
1657 1660
  */
1658
-static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
1659
-  float old_feedrate = feedrate;
1661
+static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) {
1662
+  float old_feedrate_mm_m = feedrate_mm_m;
1660 1663
 
1661 1664
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1662 1665
     if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), NULL, x, y, z);
@@ -1664,7 +1667,7 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0
1664 1667
 
1665 1668
   #if ENABLED(DELTA)
1666 1669
 
1667
-    feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
1670
+    feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
1668 1671
 
1669 1672
     destination[X_AXIS] = x;
1670 1673
     destination[Y_AXIS] = y;
@@ -1679,19 +1682,19 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0
1679 1682
 
1680 1683
     // If Z needs to raise, do it before moving XY
1681 1684
     if (current_position[Z_AXIS] < z) {
1682
-      feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
1685
+      feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS];
1683 1686
       current_position[Z_AXIS] = z;
1684 1687
       line_to_current_position();
1685 1688
     }
1686 1689
 
1687
-    feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
1690
+    feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
1688 1691
     current_position[X_AXIS] = x;
1689 1692
     current_position[Y_AXIS] = y;
1690 1693
     line_to_current_position();
1691 1694
 
1692 1695
     // If Z needs to lower, do it after moving XY
1693 1696
     if (current_position[Z_AXIS] > z) {
1694
-      feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
1697
+      feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS];
1695 1698
       current_position[Z_AXIS] = z;
1696 1699
       line_to_current_position();
1697 1700
     }
@@ -1700,23 +1703,23 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0
1700 1703
 
1701 1704
   stepper.synchronize();
1702 1705
 
1703
-  feedrate = old_feedrate;
1706
+  feedrate_mm_m = old_feedrate_mm_m;
1704 1707
 }
1705 1708
 
1706
-inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
1707
-  do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
1709
+inline void do_blocking_move_to_x(float x, float fr_mm_m = 0.0) {
1710
+  do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m);
1708 1711
 }
1709 1712
 
1710 1713
 inline void do_blocking_move_to_y(float y) {
1711 1714
   do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]);
1712 1715
 }
1713 1716
 
1714
-inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) {
1715
-  do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate);
1717
+inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m = 0.0) {
1718
+  do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m);
1716 1719
 }
1717 1720
 
1718
-inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
1719
-  do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
1721
+inline void do_blocking_move_to_z(float z, float fr_mm_m = 0.0) {
1722
+  do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_m);
1720 1723
 }
1721 1724
 
1722 1725
 //
@@ -1732,9 +1735,9 @@ static void setup_for_endstop_or_probe_move() {
1732 1735
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1733 1736
     if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position);
1734 1737
   #endif
1735
-  saved_feedrate = feedrate;
1736
-  saved_feedrate_multiplier = feedrate_multiplier;
1737
-  feedrate_multiplier = 100;
1738
+  saved_feedrate_mm_m = feedrate_mm_m;
1739
+  saved_feedrate_percentage = feedrate_percentage;
1740
+  feedrate_percentage = 100;
1738 1741
   refresh_cmd_timeout();
1739 1742
 }
1740 1743
 
@@ -1742,8 +1745,8 @@ static void clean_up_after_endstop_or_probe_move() {
1742 1745
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1743 1746
     if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position);
1744 1747
   #endif
1745
-  feedrate = saved_feedrate;
1746
-  feedrate_multiplier = saved_feedrate_multiplier;
1748
+  feedrate_mm_m = saved_feedrate_mm_m;
1749
+  feedrate_percentage = saved_feedrate_percentage;
1747 1750
   refresh_cmd_timeout();
1748 1751
 }
1749 1752
 
@@ -2061,7 +2064,7 @@ static void clean_up_after_endstop_or_probe_move() {
2061 2064
   // at the height where the probe triggered.
2062 2065
   static float run_z_probe() {
2063 2066
 
2064
-    float old_feedrate = feedrate;
2067
+    float old_feedrate_mm_m = feedrate_mm_m;
2065 2068
 
2066 2069
     // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding
2067 2070
     refresh_cmd_timeout();
@@ -2076,7 +2079,7 @@ static void clean_up_after_endstop_or_probe_move() {
2076 2079
       #endif
2077 2080
 
2078 2081
       // move down slowly until you find the bed
2079
-      feedrate = homing_feedrate[Z_AXIS] / 4;
2082
+      feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS] / 4;
2080 2083
       destination[Z_AXIS] = -10;
2081 2084
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
2082 2085
       stepper.synchronize();
@@ -2100,7 +2103,7 @@ static void clean_up_after_endstop_or_probe_move() {
2100 2103
         planner.bed_level_matrix.set_to_identity();
2101 2104
       #endif
2102 2105
 
2103
-      feedrate = homing_feedrate[Z_AXIS];
2106
+      feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS];
2104 2107
 
2105 2108
       // Move down until the Z probe (or endstop?) is triggered
2106 2109
       float zPosition = -(Z_MAX_LENGTH + 10);
@@ -2139,7 +2142,7 @@ static void clean_up_after_endstop_or_probe_move() {
2139 2142
 
2140 2143
     SYNC_PLAN_POSITION_KINEMATIC();
2141 2144
 
2142
-    feedrate = old_feedrate;
2145
+    feedrate_mm_m = old_feedrate_mm_m;
2143 2146
 
2144 2147
     return current_position[Z_AXIS];
2145 2148
   }
@@ -2164,7 +2167,7 @@ static void clean_up_after_endstop_or_probe_move() {
2164 2167
       }
2165 2168
     #endif
2166 2169
 
2167
-    float old_feedrate = feedrate;
2170
+    float old_feedrate_mm_m = feedrate_mm_m;
2168 2171
 
2169 2172
     // Ensure a minimum height before moving the probe
2170 2173
     do_probe_raise(Z_RAISE_BETWEEN_PROBINGS);
@@ -2177,7 +2180,7 @@ static void clean_up_after_endstop_or_probe_move() {
2177 2180
         SERIAL_ECHOLNPGM(")");
2178 2181
       }
2179 2182
     #endif
2180
-    feedrate = XY_PROBE_FEEDRATE;
2183
+    feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M;
2181 2184
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2182 2185
 
2183 2186
     #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -2214,7 +2217,7 @@ static void clean_up_after_endstop_or_probe_move() {
2214 2217
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
2215 2218
     #endif
2216 2219
 
2217
-    feedrate = old_feedrate;
2220
+    feedrate_mm_m = old_feedrate_mm_m;
2218 2221
 
2219 2222
     return measured_z;
2220 2223
   }
@@ -2415,7 +2418,7 @@ static void homeaxis(AxisEnum axis) {
2415 2418
 
2416 2419
   // Move towards the endstop until an endstop is triggered
2417 2420
   destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
2418
-  feedrate = homing_feedrate[axis];
2421
+  feedrate_mm_m = homing_feedrate_mm_m[axis];
2419 2422
   line_to_destination();
2420 2423
   stepper.synchronize();
2421 2424
 
@@ -2455,7 +2458,7 @@ static void homeaxis(AxisEnum axis) {
2455 2458
       sync_plan_position();
2456 2459
 
2457 2460
       // Move to the adjusted endstop height
2458
-      feedrate = homing_feedrate[axis];
2461
+      feedrate_mm_m = homing_feedrate_mm_m[axis];
2459 2462
       destination[Z_AXIS] = adj;
2460 2463
       line_to_destination();
2461 2464
       stepper.synchronize();
@@ -2519,13 +2522,13 @@ static void homeaxis(AxisEnum axis) {
2519 2522
 
2520 2523
     if (retracting == retracted[active_extruder]) return;
2521 2524
 
2522
-    float old_feedrate = feedrate;
2525
+    float old_feedrate_mm_m = feedrate_mm_m;
2523 2526
 
2524 2527
     set_destination_to_current();
2525 2528
 
2526 2529
     if (retracting) {
2527 2530
 
2528
-      feedrate = retract_feedrate_mm_s * 60;
2531
+      feedrate_mm_m = MMS_TO_MMM(retract_feedrate_mm_s);
2529 2532
       current_position[E_AXIS] += (swapping ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder];
2530 2533
       sync_plan_position_e();
2531 2534
       prepare_move_to_destination();
@@ -2543,14 +2546,14 @@ static void homeaxis(AxisEnum axis) {
2543 2546
         SYNC_PLAN_POSITION_KINEMATIC();
2544 2547
       }
2545 2548
 
2546
-      feedrate = retract_recover_feedrate * 60;
2549
+      feedrate_mm_m = MMM_TO_MMS(retract_recover_feedrate_mm_s);
2547 2550
       float move_e = swapping ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length;
2548 2551
       current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder];
2549 2552
       sync_plan_position_e();
2550 2553
       prepare_move_to_destination();
2551 2554
     }
2552 2555
 
2553
-    feedrate = old_feedrate;
2556
+    feedrate_mm_m = old_feedrate_mm_m;
2554 2557
     retracted[active_extruder] = retracting;
2555 2558
 
2556 2559
   } // retract()
@@ -2612,10 +2615,10 @@ void gcode_get_destination() {
2612 2615
   }
2613 2616
 
2614 2617
   if (code_seen('F') && code_value_linear_units() > 0.0)
2615
-    feedrate = code_value_linear_units();
2618
+    feedrate_mm_m = code_value_linear_units();
2616 2619
 
2617 2620
   #if ENABLED(PRINTCOUNTER)
2618
-    if(!DEBUGGING(DRYRUN))
2621
+    if (!DEBUGGING(DRYRUN))
2619 2622
       print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]);
2620 2623
   #endif
2621 2624
 
@@ -2845,7 +2848,7 @@ inline void gcode_G4() {
2845 2848
 
2846 2849
     destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir;
2847 2850
     destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS);
2848
-    feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1);
2851
+    feedrate_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1);
2849 2852
     line_to_destination();
2850 2853
     stepper.synchronize();
2851 2854
     endstops.hit_on_purpose(); // clear endstop hit flags
@@ -2942,7 +2945,7 @@ inline void gcode_G28() {
2942 2945
 
2943 2946
     // Move all carriages up together until the first endstop is hit.
2944 2947
     for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH);
2945
-    feedrate = 1.732 * homing_feedrate[X_AXIS];
2948
+    feedrate_mm_m = 1.732 * homing_feedrate_mm_m[X_AXIS];
2946 2949
     line_to_destination();
2947 2950
     stepper.synchronize();
2948 2951
     endstops.hit_on_purpose(); // clear endstop hit flags
@@ -3163,7 +3166,7 @@ inline void gcode_G28() {
3163 3166
         #if ENABLED(MESH_G28_REST_ORIGIN)
3164 3167
           current_position[Z_AXIS] = 0.0;
3165 3168
           set_destination_to_current();
3166
-          feedrate = homing_feedrate[Z_AXIS];
3169
+          feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS];
3167 3170
           line_to_destination();
3168 3171
           stepper.synchronize();
3169 3172
           #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -3223,8 +3226,8 @@ inline void gcode_G28() {
3223 3226
   enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset };
3224 3227
 
3225 3228
   inline void _mbl_goto_xy(float x, float y) {
3226
-    float old_feedrate = feedrate;
3227
-    feedrate = homing_feedrate[X_AXIS];
3229
+    float old_feedrate_mm_m = feedrate_mm_m;
3230
+    feedrate_mm_m = homing_feedrate_mm_m[X_AXIS];
3228 3231
 
3229 3232
     current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
3230 3233
       #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING
@@ -3244,7 +3247,7 @@ inline void gcode_G28() {
3244 3247
       line_to_current_position();
3245 3248
     #endif
3246 3249
 
3247
-    feedrate = old_feedrate;
3250
+    feedrate_mm_m = old_feedrate_mm_m;
3248 3251
     stepper.synchronize();
3249 3252
   }
3250 3253
 
@@ -3491,7 +3494,7 @@ inline void gcode_G28() {
3491 3494
         }
3492 3495
       #endif
3493 3496
 
3494
-      xy_probe_speed = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED;
3497
+      xy_probe_feedrate_mm_m = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED;
3495 3498
 
3496 3499
       int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION,
3497 3500
           right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION,
@@ -5162,7 +5165,7 @@ inline void gcode_M92() {
5162 5165
         if (value < 20.0) {
5163 5166
           float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab.
5164 5167
           planner.max_e_jerk *= factor;
5165
-          planner.max_feedrate[i] *= factor;
5168
+          planner.max_feedrate_mm_s[i] *= factor;
5166 5169
           planner.max_acceleration_steps_per_s2[i] *= factor;
5167 5170
         }
5168 5171
         planner.axis_steps_per_mm[i] = value;
@@ -5371,7 +5374,7 @@ inline void gcode_M201() {
5371 5374
 inline void gcode_M203() {
5372 5375
   for (int8_t i = 0; i < NUM_AXIS; i++)
5373 5376
     if (code_seen(axis_codes[i]))
5374
-      planner.max_feedrate[i] = code_value_axis_units(i);
5377
+      planner.max_feedrate_mm_s[i] = code_value_axis_units(i);
5375 5378
 }
5376 5379
 
5377 5380
 /**
@@ -5417,8 +5420,8 @@ inline void gcode_M204() {
5417 5420
  *    E = Max E Jerk (units/sec^2)
5418 5421
  */
5419 5422
 inline void gcode_M205() {
5420
-  if (code_seen('S')) planner.min_feedrate = code_value_linear_units();
5421
-  if (code_seen('T')) planner.min_travel_feedrate = code_value_linear_units();
5423
+  if (code_seen('S')) planner.min_feedrate_mm_s = code_value_linear_units();
5424
+  if (code_seen('T')) planner.min_travel_feedrate_mm_s = code_value_linear_units();
5422 5425
   if (code_seen('B')) planner.min_segment_time = code_value_millis();
5423 5426
   if (code_seen('X')) planner.max_xy_jerk = code_value_linear_units();
5424 5427
   if (code_seen('Z')) planner.max_z_jerk = code_value_axis_units(Z_AXIS);
@@ -5516,7 +5519,7 @@ inline void gcode_M206() {
5516 5519
    */
5517 5520
   inline void gcode_M207() {
5518 5521
     if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS);
5519
-    if (code_seen('F')) retract_feedrate_mm_s = code_value_axis_units(E_AXIS) / 60;
5522
+    if (code_seen('F')) retract_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS));
5520 5523
     if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS);
5521 5524
     #if EXTRUDERS > 1
5522 5525
       if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS);
@@ -5528,11 +5531,11 @@ inline void gcode_M206() {
5528 5531
    *
5529 5532
    *   S[+units]    retract_recover_length (in addition to M207 S*)
5530 5533
    *   W[+units]    retract_recover_length_swap (multi-extruder)
5531
-   *   F[units/min] retract_recover_feedrate
5534
+   *   F[units/min] retract_recover_feedrate_mm_s
5532 5535
    */
5533 5536
   inline void gcode_M208() {
5534 5537
     if (code_seen('S')) retract_recover_length = code_value_axis_units(E_AXIS);
5535
-    if (code_seen('F')) retract_recover_feedrate = code_value_axis_units(E_AXIS) / 60;
5538
+    if (code_seen('F')) retract_recover_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS));
5536 5539
     #if EXTRUDERS > 1
5537 5540
       if (code_seen('W')) retract_recover_length_swap = code_value_axis_units(E_AXIS);
5538 5541
     #endif
@@ -5603,7 +5606,7 @@ inline void gcode_M206() {
5603 5606
  * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
5604 5607
  */
5605 5608
 inline void gcode_M220() {
5606
-  if (code_seen('S')) feedrate_multiplier = code_value_int();
5609
+  if (code_seen('S')) feedrate_percentage = code_value_int();
5607 5610
 }
5608 5611
 
5609 5612
 /**
@@ -6307,10 +6310,10 @@ inline void gcode_M503() {
6307 6310
 
6308 6311
     // Define runplan for move axes
6309 6312
     #if ENABLED(DELTA)
6310
-      #define RUNPLAN(RATE) calculate_delta(destination); \
6311
-                            planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE, active_extruder);
6313
+      #define RUNPLAN(RATE_MM_S) calculate_delta(destination); \
6314
+                                 planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE_MM_S, active_extruder);
6312 6315
     #else
6313
-      #define RUNPLAN(RATE) line_to_destination(RATE * 60);
6316
+      #define RUNPLAN(RATE_MM_S) line_to_destination(MMS_TO_MMM(RATE_MM_S));
6314 6317
     #endif
6315 6318
 
6316 6319
     KEEPALIVE_STATE(IN_HANDLER);
@@ -6725,14 +6728,14 @@ inline void gcode_T(uint8_t tmp_extruder) {
6725 6728
         return;
6726 6729
       }
6727 6730
 
6728
-      float old_feedrate = feedrate;
6731
+      float old_feedrate_mm_m = feedrate_mm_m;
6729 6732
 
6730 6733
       if (code_seen('F')) {
6731
-        float next_feedrate = code_value_axis_units(X_AXIS);
6732
-        if (next_feedrate > 0.0) old_feedrate = feedrate = next_feedrate;
6734
+        float next_feedrate_mm_m = code_value_axis_units(X_AXIS);
6735
+        if (next_feedrate_mm_m > 0.0) old_feedrate_mm_m = feedrate_mm_m = next_feedrate_mm_m;
6733 6736
       }
6734 6737
       else
6735
-        feedrate = XY_PROBE_FEEDRATE;
6738
+        feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M;
6736 6739
 
6737 6740
       if (tmp_extruder != active_extruder) {
6738 6741
         bool no_move = code_seen('S') && code_value_bool();
@@ -6775,7 +6778,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6775 6778
                 current_position[Y_AXIS],
6776 6779
                 current_position[Z_AXIS] + (i == 2 ? 0 : TOOLCHANGE_PARK_ZLIFT),
6777 6780
                 current_position[E_AXIS],
6778
-                planner.max_feedrate[i == 1 ? X_AXIS : Z_AXIS],
6781
+                planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS],
6779 6782
                 active_extruder
6780 6783
               );
6781 6784
             stepper.synchronize();
@@ -6838,7 +6841,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6838 6841
               current_position[Y_AXIS],
6839 6842
               current_position[Z_AXIS] + z_raise,
6840 6843
               current_position[E_AXIS],
6841
-              planner.max_feedrate[Z_AXIS],
6844
+              planner.max_feedrate_mm_s[Z_AXIS],
6842 6845
               active_extruder
6843 6846
             );
6844 6847
             stepper.synchronize();
@@ -6853,7 +6856,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6853 6856
                 current_position[Y_AXIS],
6854 6857
                 current_position[Z_AXIS] + z_diff,
6855 6858
                 current_position[E_AXIS],
6856
-                planner.max_feedrate[Z_AXIS],
6859
+                planner.max_feedrate_mm_s[Z_AXIS],
6857 6860
                 active_extruder
6858 6861
               );
6859 6862
               stepper.synchronize();
@@ -6984,7 +6987,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6984 6987
         enable_solenoid_on_active_extruder();
6985 6988
       #endif // EXT_SOLENOID
6986 6989
 
6987
-      feedrate = old_feedrate;
6990
+      feedrate_mm_m = old_feedrate_mm_m;
6988 6991
 
6989 6992
     #else // HOTENDS <= 1
6990 6993
 
@@ -7837,9 +7840,9 @@ void clamp_to_software_endstops(float target[3]) {
7837 7840
 #if ENABLED(MESH_BED_LEVELING)
7838 7841
 
7839 7842
 // This function is used to split lines on mesh borders so each segment is only part of one mesh area
7840
-void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
7843
+void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
7841 7844
   if (!mbl.active()) {
7842
-    planner.buffer_line(x, y, z, e, feed_rate, extruder);
7845
+    planner.buffer_line(x, y, z, e, fr_mm_s, extruder);
7843 7846
     set_current_to_destination();
7844 7847
     return;
7845 7848
   }
@@ -7853,7 +7856,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7853 7856
   NOMORE(cy,  MESH_NUM_Y_POINTS - 2);
7854 7857
   if (pcx == cx && pcy == cy) {
7855 7858
     // Start and end on same mesh square
7856
-    planner.buffer_line(x, y, z, e, feed_rate, extruder);
7859
+    planner.buffer_line(x, y, z, e, fr_mm_s, extruder);
7857 7860
     set_current_to_destination();
7858 7861
     return;
7859 7862
   }
@@ -7892,7 +7895,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7892 7895
   }
7893 7896
   else {
7894 7897
     // Already split on a border
7895
-    planner.buffer_line(x, y, z, e, feed_rate, extruder);
7898
+    planner.buffer_line(x, y, z, e, fr_mm_s, extruder);
7896 7899
     set_current_to_destination();
7897 7900
     return;
7898 7901
   }
@@ -7901,12 +7904,12 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7901 7904
   destination[Y_AXIS] = ny;
7902 7905
   destination[Z_AXIS] = nz;
7903 7906
   destination[E_AXIS] = ne;
7904
-  mesh_buffer_line(nx, ny, nz, ne, feed_rate, extruder, x_splits, y_splits);
7907
+  mesh_buffer_line(nx, ny, nz, ne, fr_mm_s, extruder, x_splits, y_splits);
7905 7908
   destination[X_AXIS] = x;
7906 7909
   destination[Y_AXIS] = y;
7907 7910
   destination[Z_AXIS] = z;
7908 7911
   destination[E_AXIS] = e;
7909
-  mesh_buffer_line(x, y, z, e, feed_rate, extruder, x_splits, y_splits);
7912
+  mesh_buffer_line(x, y, z, e, fr_mm_s, extruder, x_splits, y_splits);
7910 7913
 }
7911 7914
 #endif  // MESH_BED_LEVELING
7912 7915
 
@@ -7919,8 +7922,8 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7919 7922
     float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS]));
7920 7923
     if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]);
7921 7924
     if (cartesian_mm < 0.000001) return false;
7922
-    float _feedrate = feedrate * feedrate_multiplier / 6000.0;
7923
-    float seconds = cartesian_mm / _feedrate;
7925
+    float _feedrate_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m);
7926
+    float seconds = cartesian_mm / _feedrate_mm_s;
7924 7927
     int steps = max(1, int(delta_segments_per_second * seconds));
7925 7928
     float inv_steps = 1.0/steps;
7926 7929
 
@@ -7944,7 +7947,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7944 7947
       //DEBUG_POS("prepare_delta_move_to", target);
7945 7948
       //DEBUG_POS("prepare_delta_move_to", delta);
7946 7949
 
7947
-      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate, active_extruder);
7950
+      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate_mm_s, active_extruder);
7948 7951
     }
7949 7952
     return true;
7950 7953
   }
@@ -7963,7 +7966,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7963 7966
         // move duplicate extruder into correct duplication position.
7964 7967
         planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
7965 7968
         planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
7966
-                         current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1);
7969
+                         current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
7967 7970
         SYNC_PLAN_POSITION_KINEMATIC();
7968 7971
         stepper.synchronize();
7969 7972
         extruder_duplication_enabled = true;
@@ -7983,9 +7986,9 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7983 7986
         }
7984 7987
         delayed_move_time = 0;
7985 7988
         // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
7986
-        planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
7989
+        planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
7987 7990
         planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder);
7988
-        planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
7991
+        planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
7989 7992
         active_extruder_parked = false;
7990 7993
       }
7991 7994
     }
@@ -7997,16 +8000,16 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
7997 8000
 #if DISABLED(DELTA) && DISABLED(SCARA)
7998 8001
 
7999 8002
   inline bool prepare_move_to_destination_cartesian() {
8000
-    // Do not use feedrate_multiplier for E or Z only moves
8003
+    // Do not use feedrate_percentage for E or Z only moves
8001 8004
     if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) {
8002 8005
       line_to_destination();
8003 8006
     }
8004 8007
     else {
8005 8008
       #if ENABLED(MESH_BED_LEVELING)
8006
-        mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
8009
+        mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder);
8007 8010
         return false;
8008 8011
       #else
8009
-        line_to_destination(feedrate * feedrate_multiplier / 100.0);
8012
+        line_to_destination(MMM_SCALED(feedrate_mm_m));
8010 8013
       #endif
8011 8014
     }
8012 8015
     return true;
@@ -8150,7 +8153,7 @@ void prepare_move_to_destination() {
8150 8153
     // Initialize the extruder axis
8151 8154
     arc_target[E_AXIS] = current_position[E_AXIS];
8152 8155
 
8153
-    float feed_rate = feedrate * feedrate_multiplier / 60 / 100.0;
8156
+    float fr_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m);
8154 8157
 
8155 8158
     millis_t next_idle_ms = millis() + 200UL;
8156 8159
 
@@ -8194,9 +8197,9 @@ void prepare_move_to_destination() {
8194 8197
         #if ENABLED(AUTO_BED_LEVELING_FEATURE)
8195 8198
           adjust_delta(arc_target);
8196 8199
         #endif
8197
-        planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
8200
+        planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder);
8198 8201
       #else
8199
-        planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
8202
+        planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder);
8200 8203
       #endif
8201 8204
     }
8202 8205
 
@@ -8206,9 +8209,9 @@ void prepare_move_to_destination() {
8206 8209
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
8207 8210
         adjust_delta(target);
8208 8211
       #endif
8209
-      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);
8212
+      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder);
8210 8213
     #else
8211
-      planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);
8214
+      planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder);
8212 8215
     #endif
8213 8216
 
8214 8217
     // As far as the parser is concerned, the position is now == target. In reality the
@@ -8221,7 +8224,7 @@ void prepare_move_to_destination() {
8221 8224
 #if ENABLED(BEZIER_CURVE_SUPPORT)
8222 8225
 
8223 8226
   void plan_cubic_move(const float offset[4]) {
8224
-    cubic_b_spline(current_position, destination, offset, feedrate * feedrate_multiplier / 60 / 100.0, active_extruder);
8227
+    cubic_b_spline(current_position, destination, offset, MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder);
8225 8228
 
8226 8229
     // As far as the parser is concerned, the position is now == target. In reality the
8227 8230
     // motion control system might still be processing the action and the real tool position
@@ -8547,7 +8550,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8547 8550
       float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
8548 8551
       planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
8549 8552
                        destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS],
8550
-                       (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder);
8553
+                       MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder);
8551 8554
       current_position[E_AXIS] = oldepos;
8552 8555
       destination[E_AXIS] = oldedes;
8553 8556
       planner.set_e_position_mm(oldepos);

+ 24
- 24
Marlin/configuration_store.cpp View File

@@ -49,13 +49,13 @@
49 49
  *  104  EEPROM Checksum (uint16_t)
50 50
  *
51 51
  *  106  M92 XYZE  planner.axis_steps_per_mm (float x4)
52
- *  122  M203 XYZE planner.max_feedrate (float x4)
52
+ *  122  M203 XYZE planner.max_feedrate_mm_s (float x4)
53 53
  *  138  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
54 54
  *  154  M204 P    planner.acceleration (float)
55 55
  *  158  M204 R    planner.retract_acceleration (float)
56 56
  *  162  M204 T    planner.travel_acceleration (float)
57
- *  166  M205 S    planner.min_feedrate (float)
58
- *  170  M205 T    planner.min_travel_feedrate (float)
57
+ *  166  M205 S    planner.min_feedrate_mm_s (float)
58
+ *  170  M205 T    planner.min_travel_feedrate_mm_s (float)
59 59
  *  174  M205 B    planner.min_segment_time (ulong)
60 60
  *  178  M205 X    planner.max_xy_jerk (float)
61 61
  *  182  M205 Z    planner.max_z_jerk (float)
@@ -116,7 +116,7 @@
116 116
  *  406  M207 Z    retract_zlift (float)
117 117
  *  410  M208 S    retract_recover_length (float)
118 118
  *  414  M208 W    retract_recover_length_swap (float)
119
- *  418  M208 F    retract_recover_feedrate (float)
119
+ *  418  M208 F    retract_recover_feedrate_mm_s (float)
120 120
  *
121 121
  * Volumetric Extrusion:
122 122
  *  422  M200 D    volumetric_enabled (bool)
@@ -201,13 +201,13 @@ void Config_StoreSettings()  {
201 201
   eeprom_checksum = 0; // clear before first "real data"
202 202
 
203 203
   EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm);
204
-  EEPROM_WRITE_VAR(i, planner.max_feedrate);
204
+  EEPROM_WRITE_VAR(i, planner.max_feedrate_mm_s);
205 205
   EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2);
206 206
   EEPROM_WRITE_VAR(i, planner.acceleration);
207 207
   EEPROM_WRITE_VAR(i, planner.retract_acceleration);
208 208
   EEPROM_WRITE_VAR(i, planner.travel_acceleration);
209
-  EEPROM_WRITE_VAR(i, planner.min_feedrate);
210
-  EEPROM_WRITE_VAR(i, planner.min_travel_feedrate);
209
+  EEPROM_WRITE_VAR(i, planner.min_feedrate_mm_s);
210
+  EEPROM_WRITE_VAR(i, planner.min_travel_feedrate_mm_s);
211 211
   EEPROM_WRITE_VAR(i, planner.min_segment_time);
212 212
   EEPROM_WRITE_VAR(i, planner.max_xy_jerk);
213 213
   EEPROM_WRITE_VAR(i, planner.max_z_jerk);
@@ -342,7 +342,7 @@ void Config_StoreSettings()  {
342 342
       dummy = 0.0f;
343 343
       EEPROM_WRITE_VAR(i, dummy);
344 344
     #endif
345
-    EEPROM_WRITE_VAR(i, retract_recover_feedrate);
345
+    EEPROM_WRITE_VAR(i, retract_recover_feedrate_mm_s);
346 346
   #endif // FWRETRACT
347 347
 
348 348
   EEPROM_WRITE_VAR(i, volumetric_enabled);
@@ -388,14 +388,14 @@ void Config_RetrieveSettings() {
388 388
 
389 389
     // version number match
390 390
     EEPROM_READ_VAR(i, planner.axis_steps_per_mm);
391
-    EEPROM_READ_VAR(i, planner.max_feedrate);
391
+    EEPROM_READ_VAR(i, planner.max_feedrate_mm_s);
392 392
     EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2);
393 393
 
394 394
     EEPROM_READ_VAR(i, planner.acceleration);
395 395
     EEPROM_READ_VAR(i, planner.retract_acceleration);
396 396
     EEPROM_READ_VAR(i, planner.travel_acceleration);
397
-    EEPROM_READ_VAR(i, planner.min_feedrate);
398
-    EEPROM_READ_VAR(i, planner.min_travel_feedrate);
397
+    EEPROM_READ_VAR(i, planner.min_feedrate_mm_s);
398
+    EEPROM_READ_VAR(i, planner.min_travel_feedrate_mm_s);
399 399
     EEPROM_READ_VAR(i, planner.min_segment_time);
400 400
     EEPROM_READ_VAR(i, planner.max_xy_jerk);
401 401
     EEPROM_READ_VAR(i, planner.max_z_jerk);
@@ -524,7 +524,7 @@ void Config_RetrieveSettings() {
524 524
       #else
525 525
         EEPROM_READ_VAR(i, dummy);
526 526
       #endif
527
-      EEPROM_READ_VAR(i, retract_recover_feedrate);
527
+      EEPROM_READ_VAR(i, retract_recover_feedrate_mm_s);
528 528
     #endif // FWRETRACT
529 529
 
530 530
     EEPROM_READ_VAR(i, volumetric_enabled);
@@ -564,7 +564,7 @@ void Config_ResetDefault() {
564 564
   long tmp3[] = DEFAULT_MAX_ACCELERATION;
565 565
   for (uint8_t i = 0; i < NUM_AXIS; i++) {
566 566
     planner.axis_steps_per_mm[i] = tmp1[i];
567
-    planner.max_feedrate[i] = tmp2[i];
567
+    planner.max_feedrate_mm_s[i] = tmp2[i];
568 568
     planner.max_acceleration_mm_per_s2[i] = tmp3[i];
569 569
     #if ENABLED(SCARA)
570 570
       if (i < COUNT(axis_scaling))
@@ -575,9 +575,9 @@ void Config_ResetDefault() {
575 575
   planner.acceleration = DEFAULT_ACCELERATION;
576 576
   planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
577 577
   planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
578
-  planner.min_feedrate = DEFAULT_MINIMUMFEEDRATE;
578
+  planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
579 579
   planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
580
-  planner.min_travel_feedrate = DEFAULT_MINTRAVELFEEDRATE;
580
+  planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
581 581
   planner.max_xy_jerk = DEFAULT_XYJERK;
582 582
   planner.max_z_jerk = DEFAULT_ZJERK;
583 583
   planner.max_e_jerk = DEFAULT_EJERK;
@@ -653,7 +653,7 @@ void Config_ResetDefault() {
653 653
     #if EXTRUDERS > 1
654 654
       retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
655 655
     #endif
656
-    retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
656
+    retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
657 657
   #endif
658 658
 
659 659
   volumetric_enabled = false;
@@ -706,10 +706,10 @@ void Config_PrintSettings(bool forReplay) {
706 706
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
707 707
     CONFIG_ECHO_START;
708 708
   }
709
-  SERIAL_ECHOPAIR("  M203 X", planner.max_feedrate[X_AXIS]);
710
-  SERIAL_ECHOPAIR(" Y", planner.max_feedrate[Y_AXIS]);
711
-  SERIAL_ECHOPAIR(" Z", planner.max_feedrate[Z_AXIS]);
712
-  SERIAL_ECHOPAIR(" E", planner.max_feedrate[E_AXIS]);
709
+  SERIAL_ECHOPAIR("  M203 X", planner.max_feedrate_mm_s[X_AXIS]);
710
+  SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]);
711
+  SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]);
712
+  SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
713 713
   SERIAL_EOL;
714 714
 
715 715
   CONFIG_ECHO_START;
@@ -737,8 +737,8 @@ void Config_PrintSettings(bool forReplay) {
737 737
     SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)");
738 738
     CONFIG_ECHO_START;
739 739
   }
740
-  SERIAL_ECHOPAIR("  M205 S", planner.min_feedrate);
741
-  SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate);
740
+  SERIAL_ECHOPAIR("  M205 S", planner.min_feedrate_mm_s);
741
+  SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s);
742 742
   SERIAL_ECHOPAIR(" B", planner.min_segment_time);
743 743
   SERIAL_ECHOPAIR(" X", planner.max_xy_jerk);
744 744
   SERIAL_ECHOPAIR(" Z", planner.max_z_jerk);
@@ -894,7 +894,7 @@ void Config_PrintSettings(bool forReplay) {
894 894
     #if EXTRUDERS > 1
895 895
       SERIAL_ECHOPAIR(" W", retract_length_swap);
896 896
     #endif
897
-    SERIAL_ECHOPAIR(" F", retract_feedrate_mm_s * 60);
897
+    SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s));
898 898
     SERIAL_ECHOPAIR(" Z", retract_zlift);
899 899
     SERIAL_EOL;
900 900
     CONFIG_ECHO_START;
@@ -906,7 +906,7 @@ void Config_PrintSettings(bool forReplay) {
906 906
     #if EXTRUDERS > 1
907 907
       SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
908 908
     #endif
909
-    SERIAL_ECHOPAIR(" F", retract_recover_feedrate * 60);
909
+    SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s));
910 910
     SERIAL_EOL;
911 911
     CONFIG_ECHO_START;
912 912
     if (!forReplay) {

+ 1
- 1
Marlin/dogm_lcd_implementation.h View File

@@ -450,7 +450,7 @@ static void lcd_implementation_status_screen() {
450 450
 
451 451
   lcd_setFont(FONT_STATUSMENU);
452 452
   u8g.setPrintPos(12, 49);
453
-  lcd_print(itostr3(feedrate_multiplier));
453
+  lcd_print(itostr3(feedrate_percentage));
454 454
   lcd_print('%');
455 455
 
456 456
   // Status line

+ 11
- 11
Marlin/planner.cpp View File

@@ -80,20 +80,20 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE];
80 80
 volatile uint8_t Planner::block_buffer_head = 0;           // Index of the next block to be pushed
81 81
 volatile uint8_t Planner::block_buffer_tail = 0;
82 82
 
83
-float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per second
83
+float Planner::max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second
84 84
 float Planner::axis_steps_per_mm[NUM_AXIS];
85 85
 unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS];
86 86
 unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
87 87
 
88 88
 millis_t Planner::min_segment_time;
89
-float Planner::min_feedrate;
89
+float Planner::min_feedrate_mm_s;
90 90
 float Planner::acceleration;         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
91 91
 float Planner::retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
92 92
 float Planner::travel_acceleration;  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
93 93
 float Planner::max_xy_jerk;          // The largest speed change requiring no acceleration
94 94
 float Planner::max_z_jerk;
95 95
 float Planner::max_e_jerk;
96
-float Planner::min_travel_feedrate;
96
+float Planner::min_travel_feedrate_mm_s;
97 97
 
98 98
 #if ENABLED(AUTO_BED_LEVELING_FEATURE)
99 99
   matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
@@ -527,14 +527,14 @@ void Planner::check_axes_activity() {
527 527
  * Add a new linear movement to the buffer.
528 528
  *
529 529
  *  x,y,z,e   - target position in mm
530
- *  feed_rate - (target) speed of the move
530
+ *  fr_mm_s   - (target) speed of the move
531 531
  *  extruder  - target extruder
532 532
  */
533 533
 
534 534
 #if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING)
535
-  void Planner::buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder)
535
+  void Planner::buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder)
536 536
 #else
537
-  void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder)
537
+  void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder)
538 538
 #endif  // AUTO_BED_LEVELING_FEATURE
539 539
 {
540 540
   // Calculate the buffer head after we push this byte
@@ -768,9 +768,9 @@ void Planner::check_axes_activity() {
768 768
   }
769 769
 
770 770
   if (block->steps[E_AXIS])
771
-    NOLESS(feed_rate, min_feedrate);
771
+    NOLESS(fr_mm_s, min_feedrate_mm_s);
772 772
   else
773
-    NOLESS(feed_rate, min_travel_feedrate);
773
+    NOLESS(fr_mm_s, min_travel_feedrate_mm_s);
774 774
 
775 775
   /**
776 776
    * This part of the code calculates the total length of the movement.
@@ -828,7 +828,7 @@ void Planner::check_axes_activity() {
828 828
   float inverse_millimeters = 1.0 / block->millimeters;  // Inverse millimeters to remove multiple divides
829 829
 
830 830
   // Calculate moves/second for this move. No divide by zero due to previous checks.
831
-  float inverse_second = feed_rate * inverse_millimeters;
831
+  float inverse_second = fr_mm_s * inverse_millimeters;
832 832
 
833 833
   int moves_queued = movesplanned();
834 834
 
@@ -836,7 +836,7 @@ void Planner::check_axes_activity() {
836 836
   #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
837 837
     bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
838 838
     #if ENABLED(OLD_SLOWDOWN)
839
-      if (mq) feed_rate *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
839
+      if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
840 840
     #endif
841 841
     #if ENABLED(SLOWDOWN)
842 842
       //  segment time im micro seconds
@@ -895,7 +895,7 @@ void Planner::check_axes_activity() {
895 895
   float speed_factor = 1.0; //factor <=1 do decrease speed
896 896
   for (int i = 0; i < NUM_AXIS; i++) {
897 897
     current_speed[i] = delta_mm[i] * inverse_second;
898
-    float cs = fabs(current_speed[i]), mf = max_feedrate[i];
898
+    float cs = fabs(current_speed[i]), mf = max_feedrate_mm_s[i];
899 899
     if (cs > mf) speed_factor = min(speed_factor, mf / cs);
900 900
   }
901 901
 

+ 6
- 6
Marlin/planner.h View File

@@ -119,20 +119,20 @@ class Planner {
119 119
     static volatile uint8_t block_buffer_head;           // Index of the next block to be pushed
120 120
     static volatile uint8_t block_buffer_tail;
121 121
 
122
-    static float max_feedrate[NUM_AXIS]; // Max speeds in mm per second
122
+    static float max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second
123 123
     static float axis_steps_per_mm[NUM_AXIS];
124 124
     static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
125 125
     static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
126 126
 
127 127
     static millis_t min_segment_time;
128
-    static float min_feedrate;
128
+    static float min_feedrate_mm_s;
129 129
     static float acceleration;         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
130 130
     static float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
131 131
     static float travel_acceleration;  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
132 132
     static float max_xy_jerk;          // The largest speed change requiring no acceleration
133 133
     static float max_z_jerk;
134 134
     static float max_e_jerk;
135
-    static float min_travel_feedrate;
135
+    static float min_travel_feedrate_mm_s;
136 136
 
137 137
     #if ENABLED(AUTO_BED_LEVELING_FEATURE)
138 138
       static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
@@ -211,10 +211,10 @@ class Planner {
211 211
        * Add a new linear movement to the buffer.
212 212
        *
213 213
        *  x,y,z,e   - target position in mm
214
-       *  feed_rate - (target) speed of the move
214
+       *  fr_mm_s   - (target) speed of the move (mm/s)
215 215
        *  extruder  - target extruder
216 216
        */
217
-      static void buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder);
217
+      static void buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder);
218 218
 
219 219
       /**
220 220
        * Set the planner.position and individual stepper positions.
@@ -229,7 +229,7 @@ class Planner {
229 229
 
230 230
     #else
231 231
 
232
-      static void buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder);
232
+      static void buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder);
233 233
       static void set_position_mm(const float& x, const float& y, const float& z, const float& e);
234 234
 
235 235
     #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING

+ 3
- 3
Marlin/planner_bezier.cpp View File

@@ -105,7 +105,7 @@ inline static float dist1(float x1, float y1, float x2, float y2) { return fabs(
105 105
  * the mitigation offered by MIN_STEP and the small computational
106 106
  * power available on Arduino, I think it is not wise to implement it.
107 107
  */
108
-void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float feed_rate, uint8_t extruder) {
108
+void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float fr_mm_s, uint8_t extruder) {
109 109
   // Absolute first and second control points are recovered.
110 110
   float first0 = position[X_AXIS] + offset[0];
111 111
   float first1 = position[Y_AXIS] + offset[1];
@@ -193,9 +193,9 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS]
193 193
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
194 194
         adjust_delta(bez_target);
195 195
       #endif
196
-      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder);
196
+      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder);
197 197
     #else
198
-      planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder);
198
+      planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder);
199 199
     #endif
200 200
   }
201 201
 }

+ 1
- 1
Marlin/planner_bezier.h View File

@@ -36,7 +36,7 @@ void cubic_b_spline(
36 36
               const float position[NUM_AXIS], // current position
37 37
               const float target[NUM_AXIS],   // target position
38 38
               const float offset[4],          // a pair of offsets
39
-              float feed_rate,
39
+              float fr_mm_s,
40 40
               uint8_t extruder
41 41
             );
42 42
 

+ 29
- 29
Marlin/ultralcd.cpp View File

@@ -104,7 +104,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
104 104
   #if HAS_POWER_SWITCH
105 105
     extern bool powersupply;
106 106
   #endif
107
-  const float manual_feedrate[] = MANUAL_FEEDRATE;
107
+  const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
108 108
   static void lcd_main_menu();
109 109
   static void lcd_tune_menu();
110 110
   static void lcd_prepare_menu();
@@ -254,10 +254,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
254 254
    *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
255 255
    *     menu_action_function(lcd_sdcard_pause)
256 256
    *
257
-   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
258
-   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
259
-   *     lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
260
-   *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
257
+   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
258
+   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
259
+   *     lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
260
+   *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
261 261
    *
262 262
    */
263 263
   #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
@@ -523,29 +523,29 @@ static void lcd_status_screen() {
523 523
     }
524 524
 
525 525
     #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
526
-      int new_frm = feedrate_multiplier + (int32_t)encoderPosition;
526
+      int new_frm = feedrate_percentage + (int32_t)encoderPosition;
527 527
       // Dead zone at 100% feedrate
528
-      if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) {
529
-        feedrate_multiplier = 100;
528
+      if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) {
529
+        feedrate_percentage = 100;
530 530
         encoderPosition = 0;
531 531
       }
532
-      else if (feedrate_multiplier == 100) {
532
+      else if (feedrate_percentage == 100) {
533 533
         if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) {
534
-          feedrate_multiplier += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
534
+          feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
535 535
           encoderPosition = 0;
536 536
         }
537 537
         else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) {
538
-          feedrate_multiplier += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
538
+          feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
539 539
           encoderPosition = 0;
540 540
         }
541 541
       }
542 542
       else {
543
-        feedrate_multiplier = new_frm;
543
+        feedrate_percentage = new_frm;
544 544
         encoderPosition = 0;
545 545
       }
546 546
     #endif // ULTIPANEL_FEEDMULTIPLY
547 547
 
548
-    feedrate_multiplier = constrain(feedrate_multiplier, 10, 999);
548
+    feedrate_percentage = constrain(feedrate_percentage, 10, 999);
549 549
 
550 550
   #endif //ULTIPANEL
551 551
 }
@@ -573,9 +573,9 @@ void kill_screen(const char* lcd_msg) {
573 573
   inline void line_to_current(AxisEnum axis) {
574 574
     #if ENABLED(DELTA)
575 575
       calculate_delta(current_position);
576
-      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
576
+      planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
577 577
     #else // !DELTA
578
-      planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
578
+      planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
579 579
     #endif // !DELTA
580 580
   }
581 581
 
@@ -757,7 +757,7 @@ void kill_screen(const char* lcd_msg) {
757 757
     //
758 758
     // Speed:
759 759
     //
760
-    MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
760
+    MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999);
761 761
 
762 762
     // Manual bed leveling, Bed Z:
763 763
     #if ENABLED(MANUAL_BED_LEVELING)
@@ -1020,7 +1020,7 @@ void kill_screen(const char* lcd_msg) {
1020 1020
       line_to_current(Z_AXIS);
1021 1021
       current_position[X_AXIS] = x + home_offset[X_AXIS];
1022 1022
       current_position[Y_AXIS] = y + home_offset[Y_AXIS];
1023
-      line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
1023
+      line_to_current(manual_feedrate_mm_m[X_AXIS] <= manual_feedrate_mm_m[Y_AXIS] ? X_AXIS : Y_AXIS);
1024 1024
       #if MIN_Z_HEIGHT_FOR_HOMING > 0
1025 1025
         current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match?
1026 1026
         line_to_current(Z_AXIS);
@@ -1310,9 +1310,9 @@ void kill_screen(const char* lcd_msg) {
1310 1310
     if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
1311 1311
       #if ENABLED(DELTA)
1312 1312
         calculate_delta(current_position);
1313
-        planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index);
1313
+        planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
1314 1314
       #else
1315
-        planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index);
1315
+        planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
1316 1316
       #endif
1317 1317
       manual_move_axis = (int8_t)NO_AXIS;
1318 1318
     }
@@ -1800,12 +1800,12 @@ void kill_screen(const char* lcd_msg) {
1800 1800
       MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
1801 1801
     #endif
1802 1802
     MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990);
1803
-    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999);
1804
-    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999);
1805
-    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999);
1806
-    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999);
1807
-    MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999);
1808
-    MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999);
1803
+    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999);
1804
+    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999);
1805
+    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999);
1806
+    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
1807
+    MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999);
1808
+    MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999);
1809 1809
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
1810 1810
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1811 1811
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
@@ -1905,7 +1905,7 @@ void kill_screen(const char* lcd_msg) {
1905 1905
       #if EXTRUDERS > 1
1906 1906
         MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
1907 1907
       #endif
1908
-      MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
1908
+      MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate_mm_s, 1, 999);
1909 1909
       END_MENU();
1910 1910
     }
1911 1911
   #endif // FWRETRACT
@@ -2257,15 +2257,15 @@ void kill_screen(const char* lcd_msg) {
2257 2257
    *   static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callback); // edit int with callback
2258 2258
    *
2259 2259
    * You can then use one of the menu macros to present the edit interface:
2260
-   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
2260
+   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
2261 2261
    *
2262 2262
    * This expands into a more primitive menu item:
2263
-   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
2263
+   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
2264 2264
    *
2265 2265
    *
2266 2266
    * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
2267 2267
    *
2268
-   *       menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
2268
+   *       menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
2269 2269
    */
2270 2270
   #define menu_edit_type(_type, _name, _strFunc, scale) \
2271 2271
     bool _menu_edit_ ## _name () { \

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -742,7 +742,7 @@ static void lcd_implementation_status_screen() {
742 742
 
743 743
     lcd.setCursor(0, 2);
744 744
     lcd.print(LCD_STR_FEEDRATE[0]);
745
-    lcd.print(itostr3(feedrate_multiplier));
745
+    lcd.print(itostr3(feedrate_percentage));
746 746
     lcd.print('%');
747 747
 
748 748
     #if LCD_WIDTH > 19 && ENABLED(SDSUPPORT)

Loading…
Cancel
Save