Browse Source

Append units to feedrate variables

Scott Lahteine 9 years ago
parent
commit
93ba5bddd7

+ 12
- 2
Marlin/Marlin.h View File

296
   #define CRITICAL_SECTION_END    SREG = _sreg;
296
   #define CRITICAL_SECTION_END    SREG = _sreg;
297
 #endif
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
 extern bool axis_relative_modes[];
310
 extern bool axis_relative_modes[];
300
-extern int feedrate_multiplier;
301
 extern bool volumetric_enabled;
311
 extern bool volumetric_enabled;
302
 extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
312
 extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
303
 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.
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
   extern bool autoretract_enabled;
395
   extern bool autoretract_enabled;
386
   extern bool retracted[EXTRUDERS]; // extruder[n].retracted
396
   extern bool retracted[EXTRUDERS]; // extruder[n].retracted
387
   extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift;
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
 #endif
399
 #endif
390
 
400
 
391
 // Print job timer
401
 // Print job timer

+ 101
- 98
Marlin/Marlin_main.cpp View File

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

+ 24
- 24
Marlin/configuration_store.cpp View File

49
  *  104  EEPROM Checksum (uint16_t)
49
  *  104  EEPROM Checksum (uint16_t)
50
  *
50
  *
51
  *  106  M92 XYZE  planner.axis_steps_per_mm (float x4)
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
  *  138  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
53
  *  138  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
54
  *  154  M204 P    planner.acceleration (float)
54
  *  154  M204 P    planner.acceleration (float)
55
  *  158  M204 R    planner.retract_acceleration (float)
55
  *  158  M204 R    planner.retract_acceleration (float)
56
  *  162  M204 T    planner.travel_acceleration (float)
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
  *  174  M205 B    planner.min_segment_time (ulong)
59
  *  174  M205 B    planner.min_segment_time (ulong)
60
  *  178  M205 X    planner.max_xy_jerk (float)
60
  *  178  M205 X    planner.max_xy_jerk (float)
61
  *  182  M205 Z    planner.max_z_jerk (float)
61
  *  182  M205 Z    planner.max_z_jerk (float)
116
  *  406  M207 Z    retract_zlift (float)
116
  *  406  M207 Z    retract_zlift (float)
117
  *  410  M208 S    retract_recover_length (float)
117
  *  410  M208 S    retract_recover_length (float)
118
  *  414  M208 W    retract_recover_length_swap (float)
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
  * Volumetric Extrusion:
121
  * Volumetric Extrusion:
122
  *  422  M200 D    volumetric_enabled (bool)
122
  *  422  M200 D    volumetric_enabled (bool)
201
   eeprom_checksum = 0; // clear before first "real data"
201
   eeprom_checksum = 0; // clear before first "real data"
202
 
202
 
203
   EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm);
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
   EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2);
205
   EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2);
206
   EEPROM_WRITE_VAR(i, planner.acceleration);
206
   EEPROM_WRITE_VAR(i, planner.acceleration);
207
   EEPROM_WRITE_VAR(i, planner.retract_acceleration);
207
   EEPROM_WRITE_VAR(i, planner.retract_acceleration);
208
   EEPROM_WRITE_VAR(i, planner.travel_acceleration);
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
   EEPROM_WRITE_VAR(i, planner.min_segment_time);
211
   EEPROM_WRITE_VAR(i, planner.min_segment_time);
212
   EEPROM_WRITE_VAR(i, planner.max_xy_jerk);
212
   EEPROM_WRITE_VAR(i, planner.max_xy_jerk);
213
   EEPROM_WRITE_VAR(i, planner.max_z_jerk);
213
   EEPROM_WRITE_VAR(i, planner.max_z_jerk);
342
       dummy = 0.0f;
342
       dummy = 0.0f;
343
       EEPROM_WRITE_VAR(i, dummy);
343
       EEPROM_WRITE_VAR(i, dummy);
344
     #endif
344
     #endif
345
-    EEPROM_WRITE_VAR(i, retract_recover_feedrate);
345
+    EEPROM_WRITE_VAR(i, retract_recover_feedrate_mm_s);
346
   #endif // FWRETRACT
346
   #endif // FWRETRACT
347
 
347
 
348
   EEPROM_WRITE_VAR(i, volumetric_enabled);
348
   EEPROM_WRITE_VAR(i, volumetric_enabled);
388
 
388
 
389
     // version number match
389
     // version number match
390
     EEPROM_READ_VAR(i, planner.axis_steps_per_mm);
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
     EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2);
392
     EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2);
393
 
393
 
394
     EEPROM_READ_VAR(i, planner.acceleration);
394
     EEPROM_READ_VAR(i, planner.acceleration);
395
     EEPROM_READ_VAR(i, planner.retract_acceleration);
395
     EEPROM_READ_VAR(i, planner.retract_acceleration);
396
     EEPROM_READ_VAR(i, planner.travel_acceleration);
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
     EEPROM_READ_VAR(i, planner.min_segment_time);
399
     EEPROM_READ_VAR(i, planner.min_segment_time);
400
     EEPROM_READ_VAR(i, planner.max_xy_jerk);
400
     EEPROM_READ_VAR(i, planner.max_xy_jerk);
401
     EEPROM_READ_VAR(i, planner.max_z_jerk);
401
     EEPROM_READ_VAR(i, planner.max_z_jerk);
524
       #else
524
       #else
525
         EEPROM_READ_VAR(i, dummy);
525
         EEPROM_READ_VAR(i, dummy);
526
       #endif
526
       #endif
527
-      EEPROM_READ_VAR(i, retract_recover_feedrate);
527
+      EEPROM_READ_VAR(i, retract_recover_feedrate_mm_s);
528
     #endif // FWRETRACT
528
     #endif // FWRETRACT
529
 
529
 
530
     EEPROM_READ_VAR(i, volumetric_enabled);
530
     EEPROM_READ_VAR(i, volumetric_enabled);
564
   long tmp3[] = DEFAULT_MAX_ACCELERATION;
564
   long tmp3[] = DEFAULT_MAX_ACCELERATION;
565
   for (uint8_t i = 0; i < NUM_AXIS; i++) {
565
   for (uint8_t i = 0; i < NUM_AXIS; i++) {
566
     planner.axis_steps_per_mm[i] = tmp1[i];
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
     planner.max_acceleration_mm_per_s2[i] = tmp3[i];
568
     planner.max_acceleration_mm_per_s2[i] = tmp3[i];
569
     #if ENABLED(SCARA)
569
     #if ENABLED(SCARA)
570
       if (i < COUNT(axis_scaling))
570
       if (i < COUNT(axis_scaling))
575
   planner.acceleration = DEFAULT_ACCELERATION;
575
   planner.acceleration = DEFAULT_ACCELERATION;
576
   planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
576
   planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
577
   planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
577
   planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
578
-  planner.min_feedrate = DEFAULT_MINIMUMFEEDRATE;
578
+  planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
579
   planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
579
   planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
580
-  planner.min_travel_feedrate = DEFAULT_MINTRAVELFEEDRATE;
580
+  planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
581
   planner.max_xy_jerk = DEFAULT_XYJERK;
581
   planner.max_xy_jerk = DEFAULT_XYJERK;
582
   planner.max_z_jerk = DEFAULT_ZJERK;
582
   planner.max_z_jerk = DEFAULT_ZJERK;
583
   planner.max_e_jerk = DEFAULT_EJERK;
583
   planner.max_e_jerk = DEFAULT_EJERK;
653
     #if EXTRUDERS > 1
653
     #if EXTRUDERS > 1
654
       retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
654
       retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
655
     #endif
655
     #endif
656
-    retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
656
+    retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
657
   #endif
657
   #endif
658
 
658
 
659
   volumetric_enabled = false;
659
   volumetric_enabled = false;
706
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
706
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
707
     CONFIG_ECHO_START;
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
   SERIAL_EOL;
713
   SERIAL_EOL;
714
 
714
 
715
   CONFIG_ECHO_START;
715
   CONFIG_ECHO_START;
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)");
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
     CONFIG_ECHO_START;
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
   SERIAL_ECHOPAIR(" B", planner.min_segment_time);
742
   SERIAL_ECHOPAIR(" B", planner.min_segment_time);
743
   SERIAL_ECHOPAIR(" X", planner.max_xy_jerk);
743
   SERIAL_ECHOPAIR(" X", planner.max_xy_jerk);
744
   SERIAL_ECHOPAIR(" Z", planner.max_z_jerk);
744
   SERIAL_ECHOPAIR(" Z", planner.max_z_jerk);
894
     #if EXTRUDERS > 1
894
     #if EXTRUDERS > 1
895
       SERIAL_ECHOPAIR(" W", retract_length_swap);
895
       SERIAL_ECHOPAIR(" W", retract_length_swap);
896
     #endif
896
     #endif
897
-    SERIAL_ECHOPAIR(" F", retract_feedrate_mm_s * 60);
897
+    SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s));
898
     SERIAL_ECHOPAIR(" Z", retract_zlift);
898
     SERIAL_ECHOPAIR(" Z", retract_zlift);
899
     SERIAL_EOL;
899
     SERIAL_EOL;
900
     CONFIG_ECHO_START;
900
     CONFIG_ECHO_START;
906
     #if EXTRUDERS > 1
906
     #if EXTRUDERS > 1
907
       SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
907
       SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
908
     #endif
908
     #endif
909
-    SERIAL_ECHOPAIR(" F", retract_recover_feedrate * 60);
909
+    SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s));
910
     SERIAL_EOL;
910
     SERIAL_EOL;
911
     CONFIG_ECHO_START;
911
     CONFIG_ECHO_START;
912
     if (!forReplay) {
912
     if (!forReplay) {

+ 1
- 1
Marlin/dogm_lcd_implementation.h View File

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

+ 11
- 11
Marlin/planner.cpp View File

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

+ 6
- 6
Marlin/planner.h View File

119
     static volatile uint8_t block_buffer_head;           // Index of the next block to be pushed
119
     static volatile uint8_t block_buffer_head;           // Index of the next block to be pushed
120
     static volatile uint8_t block_buffer_tail;
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
     static float axis_steps_per_mm[NUM_AXIS];
123
     static float axis_steps_per_mm[NUM_AXIS];
124
     static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
124
     static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
125
     static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
125
     static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
126
 
126
 
127
     static millis_t min_segment_time;
127
     static millis_t min_segment_time;
128
-    static float min_feedrate;
128
+    static float min_feedrate_mm_s;
129
     static float acceleration;         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
129
     static float acceleration;         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
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
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
     static float travel_acceleration;  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
131
     static float travel_acceleration;  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
132
     static float max_xy_jerk;          // The largest speed change requiring no acceleration
132
     static float max_xy_jerk;          // The largest speed change requiring no acceleration
133
     static float max_z_jerk;
133
     static float max_z_jerk;
134
     static float max_e_jerk;
134
     static float max_e_jerk;
135
-    static float min_travel_feedrate;
135
+    static float min_travel_feedrate_mm_s;
136
 
136
 
137
     #if ENABLED(AUTO_BED_LEVELING_FEATURE)
137
     #if ENABLED(AUTO_BED_LEVELING_FEATURE)
138
       static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
138
       static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
211
        * Add a new linear movement to the buffer.
211
        * Add a new linear movement to the buffer.
212
        *
212
        *
213
        *  x,y,z,e   - target position in mm
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
        *  extruder  - target extruder
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
        * Set the planner.position and individual stepper positions.
220
        * Set the planner.position and individual stepper positions.
229
 
229
 
230
     #else
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
       static void set_position_mm(const float& x, const float& y, const float& z, const float& e);
233
       static void set_position_mm(const float& x, const float& y, const float& z, const float& e);
234
 
234
 
235
     #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING
235
     #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING

+ 3
- 3
Marlin/planner_bezier.cpp View File

105
  * the mitigation offered by MIN_STEP and the small computational
105
  * the mitigation offered by MIN_STEP and the small computational
106
  * power available on Arduino, I think it is not wise to implement it.
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
   // Absolute first and second control points are recovered.
109
   // Absolute first and second control points are recovered.
110
   float first0 = position[X_AXIS] + offset[0];
110
   float first0 = position[X_AXIS] + offset[0];
111
   float first1 = position[Y_AXIS] + offset[1];
111
   float first1 = position[Y_AXIS] + offset[1];
193
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
193
       #if ENABLED(AUTO_BED_LEVELING_FEATURE)
194
         adjust_delta(bez_target);
194
         adjust_delta(bez_target);
195
       #endif
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
     #else
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
     #endif
199
     #endif
200
   }
200
   }
201
 }
201
 }

+ 1
- 1
Marlin/planner_bezier.h View File

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

+ 29
- 29
Marlin/ultralcd.cpp View File

104
   #if HAS_POWER_SWITCH
104
   #if HAS_POWER_SWITCH
105
     extern bool powersupply;
105
     extern bool powersupply;
106
   #endif
106
   #endif
107
-  const float manual_feedrate[] = MANUAL_FEEDRATE;
107
+  const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
108
   static void lcd_main_menu();
108
   static void lcd_main_menu();
109
   static void lcd_tune_menu();
109
   static void lcd_tune_menu();
110
   static void lcd_prepare_menu();
110
   static void lcd_prepare_menu();
254
    *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
254
    *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
255
    *     menu_action_function(lcd_sdcard_pause)
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
   #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
263
   #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
523
     }
523
     }
524
 
524
 
525
     #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
525
     #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
526
-      int new_frm = feedrate_multiplier + (int32_t)encoderPosition;
526
+      int new_frm = feedrate_percentage + (int32_t)encoderPosition;
527
       // Dead zone at 100% feedrate
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
         encoderPosition = 0;
530
         encoderPosition = 0;
531
       }
531
       }
532
-      else if (feedrate_multiplier == 100) {
532
+      else if (feedrate_percentage == 100) {
533
         if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) {
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
           encoderPosition = 0;
535
           encoderPosition = 0;
536
         }
536
         }
537
         else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) {
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
           encoderPosition = 0;
539
           encoderPosition = 0;
540
         }
540
         }
541
       }
541
       }
542
       else {
542
       else {
543
-        feedrate_multiplier = new_frm;
543
+        feedrate_percentage = new_frm;
544
         encoderPosition = 0;
544
         encoderPosition = 0;
545
       }
545
       }
546
     #endif // ULTIPANEL_FEEDMULTIPLY
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
   #endif //ULTIPANEL
550
   #endif //ULTIPANEL
551
 }
551
 }
573
   inline void line_to_current(AxisEnum axis) {
573
   inline void line_to_current(AxisEnum axis) {
574
     #if ENABLED(DELTA)
574
     #if ENABLED(DELTA)
575
       calculate_delta(current_position);
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
     #else // !DELTA
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
     #endif // !DELTA
579
     #endif // !DELTA
580
   }
580
   }
581
 
581
 
757
     //
757
     //
758
     // Speed:
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
     // Manual bed leveling, Bed Z:
762
     // Manual bed leveling, Bed Z:
763
     #if ENABLED(MANUAL_BED_LEVELING)
763
     #if ENABLED(MANUAL_BED_LEVELING)
1020
       line_to_current(Z_AXIS);
1020
       line_to_current(Z_AXIS);
1021
       current_position[X_AXIS] = x + home_offset[X_AXIS];
1021
       current_position[X_AXIS] = x + home_offset[X_AXIS];
1022
       current_position[Y_AXIS] = y + home_offset[Y_AXIS];
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
       #if MIN_Z_HEIGHT_FOR_HOMING > 0
1024
       #if MIN_Z_HEIGHT_FOR_HOMING > 0
1025
         current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match?
1025
         current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match?
1026
         line_to_current(Z_AXIS);
1026
         line_to_current(Z_AXIS);
1310
     if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
1310
     if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
1311
       #if ENABLED(DELTA)
1311
       #if ENABLED(DELTA)
1312
         calculate_delta(current_position);
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
       #else
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
       #endif
1316
       #endif
1317
       manual_move_axis = (int8_t)NO_AXIS;
1317
       manual_move_axis = (int8_t)NO_AXIS;
1318
     }
1318
     }
1800
       MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
1800
       MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
1801
     #endif
1801
     #endif
1802
     MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990);
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
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
1809
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
1810
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1810
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1811
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
1811
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
1905
       #if EXTRUDERS > 1
1905
       #if EXTRUDERS > 1
1906
         MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
1906
         MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
1907
       #endif
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
       END_MENU();
1909
       END_MENU();
1910
     }
1910
     }
1911
   #endif // FWRETRACT
1911
   #endif // FWRETRACT
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
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
    * You can then use one of the menu macros to present the edit interface:
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
    * This expands into a more primitive menu item:
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
    * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
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
   #define menu_edit_type(_type, _name, _strFunc, scale) \
2270
   #define menu_edit_type(_type, _name, _strFunc, scale) \
2271
     bool _menu_edit_ ## _name () { \
2271
     bool _menu_edit_ ## _name () { \

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

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

Loading…
Cancel
Save