Browse Source

Merge pull request #5371 from thinkyhead/rc_extruders_can_differ

Allow distinct factors for multiple extruders
Scott Lahteine 8 years ago
parent
commit
b6b100c471
29 changed files with 495 additions and 131 deletions
  1. 13
    1
      Marlin/Conditionals_LCD.h
  2. 10
    2
      Marlin/Configuration.h
  3. 38
    9
      Marlin/Marlin_main.cpp
  4. 35
    10
      Marlin/configuration_store.cpp
  5. 1
    0
      Marlin/enum.h
  6. 11
    3
      Marlin/example_configurations/Cartesio/Configuration.h
  7. 10
    2
      Marlin/example_configurations/Felix/Configuration.h
  8. 10
    2
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  9. 10
    2
      Marlin/example_configurations/Hephestos/Configuration.h
  10. 10
    2
      Marlin/example_configurations/Hephestos_2/Configuration.h
  11. 11
    3
      Marlin/example_configurations/K8200/Configuration.h
  12. 10
    2
      Marlin/example_configurations/K8400/Configuration.h
  13. 10
    2
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  14. 11
    3
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  15. 13
    4
      Marlin/example_configurations/RigidBot/Configuration.h
  16. 11
    3
      Marlin/example_configurations/SCARA/Configuration.h
  17. 10
    2
      Marlin/example_configurations/TAZ4/Configuration.h
  18. 11
    3
      Marlin/example_configurations/WITBOX/Configuration.h
  19. 10
    2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  20. 13
    5
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  21. 11
    3
      Marlin/example_configurations/delta/generic/Configuration.h
  22. 11
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  23. 11
    3
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  24. 11
    3
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  25. 10
    2
      Marlin/example_configurations/makibox/Configuration.h
  26. 11
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  27. 63
    35
      Marlin/planner.cpp
  28. 24
    14
      Marlin/planner.h
  29. 85
    3
      Marlin/ultralcd.cpp

+ 13
- 1
Marlin/Conditionals_LCD.h View File

@@ -286,7 +286,7 @@
286 286
    *  HOTENDS      - Number of hotends, whether connected or separate
287 287
    *  E_STEPPERS   - Number of actual E stepper motors
288 288
    *  TOOL_E_INDEX - Index to use when getting/setting the tool state
289
-   *  
289
+   *
290 290
    */
291 291
   #if ENABLED(SINGLENOZZLE)             // One hotend, multi-extruder
292 292
     #define HOTENDS      1
@@ -317,6 +317,18 @@
317 317
   #endif
318 318
 
319 319
   /**
320
+   * Distinct E Factors – Disable by commenting out DISTINCT_E_FACTORS
321
+   */
322
+  #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
323
+    #define XYZE_N (XYZ + E_STEPPERS)
324
+    #define E_AXIS_N (E_AXIS + extruder)
325
+  #else
326
+    #undef DISTINCT_E_FACTORS
327
+    #define XYZE_N XYZE
328
+    #define E_AXIS_N E_AXIS
329
+  #endif
330
+
331
+  /**
320 332
    * The BLTouch Probe emulates a servo probe
321 333
    * and uses "special" angles for its state.
322 334
    */

+ 10
- 2
Marlin/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482 489
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 4000, 500 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
497 505
 

+ 38
- 9
Marlin/Marlin_main.cpp View File

@@ -1227,7 +1227,7 @@ inline bool code_value_bool() { return !code_has_value() || code_value_byte() >
1227 1227
   }
1228 1228
 
1229 1229
   inline float axis_unit_factor(int axis) {
1230
-    return (axis == E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
1230
+    return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
1231 1231
   }
1232 1232
 
1233 1233
   inline float code_value_linear_units() { return code_value_float() * linear_unit_factor; }
@@ -5795,21 +5795,37 @@ inline void gcode_M85() {
5795 5795
 }
5796 5796
 
5797 5797
 /**
5798
+ * Multi-stepper support for M92, M201, M203
5799
+ */
5800
+#if ENABLED(DISTINCT_E_FACTORS)
5801
+  #define GET_TARGET_EXTRUDER(CMD) if (get_target_extruder_from_command(CMD)) return
5802
+  #define TARGET_EXTRUDER target_extruder
5803
+#else
5804
+  #define GET_TARGET_EXTRUDER(CMD) NOOP
5805
+  #define TARGET_EXTRUDER 0
5806
+#endif
5807
+
5808
+/**
5798 5809
  * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E.
5799 5810
  *      (Follows the same syntax as G92)
5811
+ *
5812
+ *      With multiple extruders use T to specify which one.
5800 5813
  */
5801 5814
 inline void gcode_M92() {
5815
+
5816
+  GET_TARGET_EXTRUDER(92);
5817
+
5802 5818
   LOOP_XYZE(i) {
5803 5819
     if (code_seen(axis_codes[i])) {
5804 5820
       if (i == E_AXIS) {
5805
-        float value = code_value_per_axis_unit(i);
5821
+        float value = code_value_per_axis_unit(E_AXIS + TARGET_EXTRUDER);
5806 5822
         if (value < 20.0) {
5807
-          float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab.
5823
+          float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab.
5808 5824
           planner.max_jerk[E_AXIS] *= factor;
5809
-          planner.max_feedrate_mm_s[E_AXIS] *= factor;
5810
-          planner.max_acceleration_steps_per_s2[E_AXIS] *= factor;
5825
+          planner.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor;
5826
+          planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor;
5811 5827
         }
5812
-        planner.axis_steps_per_mm[E_AXIS] = value;
5828
+        planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value;
5813 5829
       }
5814 5830
       else {
5815 5831
         planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i);
@@ -6060,11 +6076,17 @@ inline void gcode_M200() {
6060 6076
 
6061 6077
 /**
6062 6078
  * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
6079
+ *
6080
+ *       With multiple extruders use T to specify which one.
6063 6081
  */
6064 6082
 inline void gcode_M201() {
6083
+
6084
+  GET_TARGET_EXTRUDER(201);
6085
+
6065 6086
   LOOP_XYZE(i) {
6066 6087
     if (code_seen(axis_codes[i])) {
6067
-      planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i);
6088
+      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
6089
+      planner.max_acceleration_mm_per_s2[a] = code_value_axis_units(a);
6068 6090
     }
6069 6091
   }
6070 6092
   // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
@@ -6082,11 +6104,18 @@ inline void gcode_M201() {
6082 6104
 
6083 6105
 /**
6084 6106
  * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
6107
+ *
6108
+ *       With multiple extruders use T to specify which one.
6085 6109
  */
6086 6110
 inline void gcode_M203() {
6111
+
6112
+  GET_TARGET_EXTRUDER(203);
6113
+
6087 6114
   LOOP_XYZE(i)
6088
-    if (code_seen(axis_codes[i]))
6089
-      planner.max_feedrate_mm_s[i] = code_value_axis_units(i);
6115
+    if (code_seen(axis_codes[i])) {
6116
+      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
6117
+      planner.max_feedrate_mm_s[a] = code_value_axis_units(a);
6118
+    }
6090 6119
 }
6091 6120
 
6092 6121
 /**

+ 35
- 10
Marlin/configuration_store.cpp View File

@@ -47,9 +47,9 @@
47 47
  *  100  Version (char x4)
48 48
  *  104  EEPROM Checksum (uint16_t)
49 49
  *
50
- *  106  M92 XYZE  planner.axis_steps_per_mm (float x4)
51
- *  122  M203 XYZE planner.max_feedrate_mm_s (float x4)
52
- *  138  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
50
+ *  106  M92 XYZE  planner.axis_steps_per_mm (float x4 ... x7)
51
+ *  122  M203 XYZE planner.max_feedrate_mm_s (float x4 ... x7)
52
+ *  138  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4 ... x7)
53 53
  *  154  M204 P    planner.acceleration (float)
54 54
  *  158  M204 R    planner.retract_acceleration (float)
55 55
  *  162  M204 T    planner.travel_acceleration (float)
@@ -571,10 +571,10 @@ void Config_Postprocess() {
571 571
 void Config_ResetDefault() {
572 572
   const float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] = DEFAULT_MAX_FEEDRATE;
573 573
   const long tmp3[] = DEFAULT_MAX_ACCELERATION;
574
-  LOOP_XYZE(i) {
575
-    planner.axis_steps_per_mm[i] = tmp1[i];
576
-    planner.max_feedrate_mm_s[i] = tmp2[i];
577
-    planner.max_acceleration_mm_per_s2[i] = tmp3[i];
574
+  LOOP_XYZE_N(i) {
575
+    planner.axis_steps_per_mm[i]          = tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1];
576
+    planner.max_feedrate_mm_s[i]          = tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1];
577
+    planner.max_acceleration_mm_per_s2[i] = tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1];
578 578
   }
579 579
 
580 580
   planner.acceleration = DEFAULT_ACCELERATION;
@@ -719,8 +719,16 @@ void Config_ResetDefault() {
719 719
     SERIAL_ECHOPAIR("  M92 X", planner.axis_steps_per_mm[X_AXIS]);
720 720
     SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_mm[Y_AXIS]);
721 721
     SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_mm[Z_AXIS]);
722
-    SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]);
722
+    #if E_STEPPERS == 1
723
+      SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]);
724
+    #endif
723 725
     SERIAL_EOL;
726
+    #if ENABLED(DISTINCT_E_FACTORS)
727
+      for (uint8_t i = 0; i < E_STEPPERS; i++) {
728
+        SERIAL_ECHOPAIR("  M92 T", (int)i);
729
+        SERIAL_ECHOLNPAIR(" E", planner.axis_steps_per_mm[E_AXIS + i]);
730
+      }
731
+    #endif
724 732
 
725 733
     CONFIG_ECHO_START;
726 734
 
@@ -731,8 +739,16 @@ void Config_ResetDefault() {
731 739
     SERIAL_ECHOPAIR("  M203 X", planner.max_feedrate_mm_s[X_AXIS]);
732 740
     SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]);
733 741
     SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]);
734
-    SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
742
+    #if E_STEPPERS == 1
743
+      SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
744
+    #endif
735 745
     SERIAL_EOL;
746
+    #if ENABLED(DISTINCT_E_FACTORS)
747
+      for (uint8_t i = 0; i < E_STEPPERS; i++) {
748
+        SERIAL_ECHOPAIR("  M203 T", (int)i);
749
+        SERIAL_ECHOLNPAIR(" E", planner.max_feedrate_mm_s[E_AXIS + i]);
750
+      }
751
+    #endif
736 752
 
737 753
     CONFIG_ECHO_START;
738 754
     if (!forReplay) {
@@ -742,8 +758,17 @@ void Config_ResetDefault() {
742 758
     SERIAL_ECHOPAIR("  M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]);
743 759
     SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]);
744 760
     SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]);
745
-    SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
761
+    #if E_STEPPERS == 1
762
+      SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
763
+    #endif
746 764
     SERIAL_EOL;
765
+    #if ENABLED(DISTINCT_E_FACTORS)
766
+      for (uint8_t i = 0; i < E_STEPPERS; i++) {
767
+        SERIAL_ECHOPAIR("  M201 T", (int)i);
768
+        SERIAL_ECHOLNPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS + i]);
769
+      }
770
+    #endif
771
+
747 772
     CONFIG_ECHO_START;
748 773
     if (!forReplay) {
749 774
       SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");

+ 1
- 0
Marlin/enum.h View File

@@ -50,6 +50,7 @@ enum AxisEnum {
50 50
 
51 51
 #define LOOP_XYZ(VAR)  for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++)
52 52
 #define LOOP_XYZE(VAR) for (uint8_t VAR=X_AXIS; VAR<=E_AXIS; VAR++)
53
+#define LOOP_XYZE_N(VAR) for (uint8_t VAR=X_AXIS; VAR<XYZE_N; VAR++)
53 54
 
54 55
 typedef enum {
55 56
   LINEARUNIT_MM,

+ 11
- 3
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -146,6 +146,9 @@
146 146
 // :[1, 2, 3, 4]
147 147
 #define EXTRUDERS 3
148 148
 
149
+// Enable if your E steppers or extruder gear ratios are not identical
150
+//#define DISTINCT_E_FACTORS
151
+
149 152
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
150 153
 //#define SINGLENOZZLE
151 154
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482 489
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 71.128, 71.128, 640, 152 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488
-#define DEFAULT_MAX_FEEDRATE          { 200, 200, 20, 20 }   // (mm/sec)
496
+#define DEFAULT_MAX_FEEDRATE          { 200, 200, 20, 20 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 100, 10000 }
497 505
 

+ 10
- 2
Marlin/example_configurations/Felix/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -455,26 +458,31 @@
455 458
  *
456 459
  * These settings can be reset by M502
457 460
  *
461
+ * You can set distinct factors for each E stepper, if needed.
462
+ * If fewer factors are given, the last will apply to the rest.
463
+ *
458 464
  * Note that if EEPROM is enabled, saved values will override these.
459 465
  */
460 466
 
461 467
 /**
462 468
  * Default Axis Steps Per Unit (steps/mm)
463 469
  * Override with M92
470
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
464 471
  */
465 472
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 76.190476, 76.190476, 1600, 164 }
466 473
 
467 474
 /**
468 475
  * Default Max Feed Rate (mm/s)
469 476
  * Override with M203
477
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
470 478
  */
471 479
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 25 }
472 480
 
473 481
 /**
474 482
  * Default Max Acceleration (change/s) change = mm/s
483
+ * (Maximum start speed for accelerated moves)
475 484
  * Override with M201
476
- *
477
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
485
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
478 486
  */
479 487
 #define DEFAULT_MAX_ACCELERATION      { 5000, 5000, 100, 80000 }
480 488
 

+ 10
- 2
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 2
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -455,26 +458,31 @@
455 458
  *
456 459
  * These settings can be reset by M502
457 460
  *
461
+ * You can set distinct factors for each E stepper, if needed.
462
+ * If fewer factors are given, the last will apply to the rest.
463
+ *
458 464
  * Note that if EEPROM is enabled, saved values will override these.
459 465
  */
460 466
 
461 467
 /**
462 468
  * Default Axis Steps Per Unit (steps/mm)
463 469
  * Override with M92
470
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
464 471
  */
465 472
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 76.190476, 76.190476, 1600, 164 }
466 473
 
467 474
 /**
468 475
  * Default Max Feed Rate (mm/s)
469 476
  * Override with M203
477
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
470 478
  */
471 479
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 25 }
472 480
 
473 481
 /**
474 482
  * Default Max Acceleration (change/s) change = mm/s
483
+ * (Maximum start speed for accelerated moves)
475 484
  * Override with M201
476
- *
477
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
485
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
478 486
  */
479 487
 #define DEFAULT_MAX_ACCELERATION      { 5000, 5000, 100, 80000 }
480 488
 

+ 10
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -148,6 +148,9 @@
148 148
 // :[1, 2, 3, 4]
149 149
 #define EXTRUDERS 1
150 150
 
151
+// Enable if your E steppers or extruder gear ratios are not identical
152
+//#define DISTINCT_E_FACTORS
153
+
151 154
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
152 155
 //#define SINGLENOZZLE
153 156
 
@@ -464,26 +467,31 @@
464 467
  *
465 468
  * These settings can be reset by M502
466 469
  *
470
+ * You can set distinct factors for each E stepper, if needed.
471
+ * If fewer factors are given, the last will apply to the rest.
472
+ *
467 473
  * Note that if EEPROM is enabled, saved values will override these.
468 474
  */
469 475
 
470 476
 /**
471 477
  * Default Axis Steps Per Unit (steps/mm)
472 478
  * Override with M92
479
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
473 480
  */
474 481
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 4000, 100.47095761381482 }
475 482
 
476 483
 /**
477 484
  * Default Max Feed Rate (mm/s)
478 485
  * Override with M203
486
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
479 487
  */
480 488
 #define DEFAULT_MAX_FEEDRATE          { 200, 200, 3.3, 25 }
481 489
 
482 490
 /**
483 491
  * Default Max Acceleration (change/s) change = mm/s
492
+ * (Maximum start speed for accelerated moves)
484 493
  * Override with M201
485
- *
486
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_ACCELERATION      { 1100, 1100, 100, 10000 }
489 497
 

+ 10
- 2
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -466,26 +469,31 @@
466 469
  *
467 470
  * These settings can be reset by M502
468 471
  *
472
+ * You can set distinct factors for each E stepper, if needed.
473
+ * If fewer factors are given, the last will apply to the rest.
474
+ *
469 475
  * Note that if EEPROM is enabled, saved values will override these.
470 476
  */
471 477
 
472 478
 /**
473 479
  * Default Axis Steps Per Unit (steps/mm)
474 480
  * Override with M92
481
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
475 482
  */
476 483
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 160, 160, 8000, 210.02 }
477 484
 
478 485
 /**
479 486
  * Default Max Feed Rate (mm/s)
480 487
  * Override with M203
488
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 489
  */
482 490
 #define DEFAULT_MAX_FEEDRATE          { 250, 250, 2, 200 }
483 491
 
484 492
 /**
485 493
  * Default Max Acceleration (change/s) change = mm/s
494
+ * (Maximum start speed for accelerated moves)
486 495
  * Override with M201
487
- *
488
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
496
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
489 497
  */
490 498
 #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 20, 1000 }
491 499
 

+ 11
- 3
Marlin/example_configurations/K8200/Configuration.h View File

@@ -165,6 +165,9 @@
165 165
 // :[1, 2, 3, 4]
166 166
 #define EXTRUDERS 1
167 167
 
168
+// Enable if your E steppers or extruder gear ratios are not identical
169
+//#define DISTINCT_E_FACTORS
170
+
168 171
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
169 172
 //#define SINGLENOZZLE
170 173
 
@@ -502,25 +505,30 @@
502 505
  *
503 506
  * These settings can be reset by M502
504 507
  *
508
+ * You can set distinct factors for each E stepper, if needed.
509
+ * If fewer factors are given, the last will apply to the rest.
510
+ *
505 511
  * Note that if EEPROM is enabled, saved values will override these.
506 512
  */
507 513
 
508 514
 /**
509 515
  * Default Axis Steps Per Unit (steps/mm)
510 516
  * Override with M92
517
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
511 518
  */
512
-#define DEFAULT_AXIS_STEPS_PER_UNIT   { 64.25, 64.25, 2560, 600}  // for K8200
519
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 64.25, 64.25, 2560, 600 }
513 520
 /**
514 521
  * Default Max Feed Rate (mm/s)
515 522
  * Override with M203
523
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
516 524
  */
517 525
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 25 }
518 526
 
519 527
 /**
520 528
  * Default Max Acceleration (change/s) change = mm/s
529
+ * (Maximum start speed for accelerated moves)
521 530
  * Override with M201
522
- *
523
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
531
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
524 532
  */
525 533
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 10000 }
526 534
 

+ 10
- 2
Marlin/example_configurations/K8400/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482 489
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 134.74, 134.74, 4266.66, 148.7 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_FEEDRATE          { 160, 160, 10, 10000 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 10000 }
497 505
 

+ 10
- 2
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 2
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482 489
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 134.74, 134.74, 4266.66, 148.7 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_FEEDRATE          { 160, 160, 10, 10000 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 10000 }
497 505
 

+ 11
- 3
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402*2,78.7402*2,5120.00,760*1*1.5}
489
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 78.7402*2, 78.7402*2, 5120.00, 760*1*1.5 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
497 505
 

+ 13
- 4
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -148,6 +148,9 @@
148 148
 // :[1, 2, 3, 4]
149 149
 #define EXTRUDERS 1  // Single extruder. Set to 2 for dual extruders
150 150
 
151
+// Enable if your E steppers or extruder gear ratios are not identical
152
+//#define DISTINCT_E_FACTORS
153
+
151 154
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
152 155
 //#define SINGLENOZZLE
153 156
 
@@ -469,27 +472,33 @@
469 472
  *
470 473
  * These settings can be reset by M502
471 474
  *
475
+ * You can set distinct factors for each E stepper, if needed.
476
+ * If fewer factors are given, the last will apply to the rest.
477
+ *
472 478
  * Note that if EEPROM is enabled, saved values will override these.
473 479
  */
474 480
 
475 481
 /**
476 482
  * Default Axis Steps Per Unit (steps/mm)
477 483
  * Override with M92
484
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
478 485
  */
479
-#define DEFAULT_AXIS_STEPS_PER_UNIT   { 44.3090, 22.1545, 1600, 53.5 }  // default steps per unit for RigidBot with standard hardware
480
-                                                                        // default steps for 16-tooth pulleys { 100.06, 50.06, 1600, 76 }, HPX2-MAX E=504, RigidBot E=53.5, Peter Stoneham's=76
486
+ // default steps per unit for RigidBot with standard hardware
487
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 44.3090, 22.1545, 1600, 53.5 }
488
+// default steps for 16-tooth pulleys { 100.06, 50.06, 1600, 76 } // HPX2-MAX E=504, RigidBot E=53.5, Peter Stoneham's=76
481 489
 
482 490
 /**
483 491
  * Default Max Feed Rate (mm/s)
484 492
  * Override with M203
493
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
485 494
  */
486 495
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 25 }
487 496
 
488 497
 /**
489 498
  * Default Max Acceleration (change/s) change = mm/s
499
+ * (Maximum start speed for accelerated moves)
490 500
  * Override with M201
491
- *
492
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
501
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
493 502
  */
494 503
 #define DEFAULT_MAX_ACCELERATION      { 800, 800, 100, 10000 }
495 504
 

+ 11
- 3
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -177,6 +177,9 @@
177 177
 // :[1, 2, 3, 4]
178 178
 #define EXTRUDERS 1
179 179
 
180
+// Enable if your E steppers or extruder gear ratios are not identical
181
+//#define DISTINCT_E_FACTORS
182
+
180 183
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
181 184
 //#define SINGLENOZZLE
182 185
 
@@ -487,26 +490,31 @@
487 490
  *
488 491
  * These settings can be reset by M502
489 492
  *
493
+ * You can set distinct factors for each E stepper, if needed.
494
+ * If fewer factors are given, the last will apply to the rest.
495
+ *
490 496
  * Note that if EEPROM is enabled, saved values will override these.
491 497
  */
492 498
 
493 499
 /**
494 500
  * Default Axis Steps Per Unit (steps/mm)
495 501
  * Override with M92
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
496 503
  */
497
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {103.69,106.65,200/1.25,1000}  // default steps per unit for SCARA
504
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 103.69, 106.65, 200/1.25, 1000 }  // default steps per unit for SCARA
498 505
 
499 506
 /**
500 507
  * Default Max Feed Rate (mm/s)
501 508
  * Override with M203
509
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
502 510
  */
503 511
 #define DEFAULT_MAX_FEEDRATE          { 300, 300, 30, 25 }
504 512
 
505 513
 /**
506 514
  * Default Max Acceleration (change/s) change = mm/s
515
+ * (Maximum start speed for accelerated moves)
507 516
  * Override with M201
508
- *
509
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
517
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
510 518
  */
511 519
 #define DEFAULT_MAX_ACCELERATION      { 300, 300, 20, 1000 }
512 520
 

+ 10
- 2
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -493,26 +496,31 @@
493 496
  *
494 497
  * These settings can be reset by M502
495 498
  *
499
+ * You can set distinct factors for each E stepper, if needed.
500
+ * If fewer factors are given, the last will apply to the rest.
501
+ *
496 502
  * Note that if EEPROM is enabled, saved values will override these.
497 503
  */
498 504
 
499 505
 /**
500 506
  * Default Axis Steps Per Unit (steps/mm)
501 507
  * Override with M92
508
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
502 509
  */
503 510
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 100.5, 100.5, 400, 850 }
504 511
 
505 512
 /**
506 513
  * Default Max Feed Rate (mm/s)
507 514
  * Override with M203
515
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
508 516
  */
509 517
 #define DEFAULT_MAX_FEEDRATE          { 800, 800, 8, 50 }
510 518
 
511 519
 /**
512 520
  * Default Max Acceleration (change/s) change = mm/s
521
+ * (Maximum start speed for accelerated moves)
513 522
  * Override with M201
514
- *
515
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
523
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
516 524
  */
517 525
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 10000 }
518 526
 

+ 11
- 3
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -148,6 +148,9 @@
148 148
 // :[1, 2, 3, 4]
149 149
 #define EXTRUDERS 1
150 150
 
151
+// Enable if your E steppers or extruder gear ratios are not identical
152
+//#define DISTINCT_E_FACTORS
153
+
151 154
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
152 155
 //#define SINGLENOZZLE
153 156
 
@@ -464,26 +467,31 @@
464 467
  *
465 468
  * These settings can be reset by M502
466 469
  *
470
+ * You can set distinct factors for each E stepper, if needed.
471
+ * If fewer factors are given, the last will apply to the rest.
472
+ *
467 473
  * Note that if EEPROM is enabled, saved values will override these.
468 474
  */
469 475
 
470 476
 /**
471 477
  * Default Axis Steps Per Unit (steps/mm)
472 478
  * Override with M92
479
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
473 480
  */
474
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,600.0*8/3,102.073}
481
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 600.0*8/3, 102.073 }
475 482
 
476 483
 /**
477 484
  * Default Max Feed Rate (mm/s)
478 485
  * Override with M203
486
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
479 487
  */
480 488
 #define DEFAULT_MAX_FEEDRATE          { 350, 350, 7.2, 80 }
481 489
 
482 490
 /**
483 491
  * Default Max Acceleration (change/s) change = mm/s
492
+ * (Maximum start speed for accelerated moves)
484 493
  * Override with M201
485
- *
486
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 10, 1000 }
489 497
 

+ 10
- 2
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -472,26 +475,31 @@
472 475
  *
473 476
  * These settings can be reset by M502
474 477
  *
478
+ * You can set distinct factors for each E stepper, if needed.
479
+ * If fewer factors are given, the last will apply to the rest.
480
+ *
475 481
  * Note that if EEPROM is enabled, saved values will override these.
476 482
  */
477 483
 
478 484
 /**
479 485
  * Default Axis Steps Per Unit (steps/mm)
480 486
  * Override with M92
487
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 488
  */
482 489
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 4000, 500 }
483 490
 
484 491
 /**
485 492
  * Default Max Feed Rate (mm/s)
486 493
  * Override with M203
494
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
487 495
  */
488 496
 #define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }
489 497
 
490 498
 /**
491 499
  * Default Max Acceleration (change/s) change = mm/s
500
+ * (Maximum start speed for accelerated moves)
492 501
  * Override with M201
493
- *
494
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
502
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
495 503
  */
496 504
 #define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
497 505
 

+ 13
- 5
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 2
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -203,7 +206,7 @@
203 206
 
204 207
 /**
205 208
  * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
206
- * 
209
+ *
207 210
  * Temperature sensors available:
208 211
  *
209 212
  *    -3 : thermocouple with MAX31855 (only for sensor 0)
@@ -228,13 +231,13 @@
228 231
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
229 232
  *    66 : 4.7M High Temperature thermistor from Dyze Design
230 233
  *    70 : the 100K thermistor found in the bq Hephestos 2
231
- * 
234
+ *
232 235
  *       1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k.
233 236
  *                              (but gives greater accuracy and more stable PID)
234 237
  *    51 : 100k thermistor - EPCOS (1k pullup)
235 238
  *    52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
236 239
  *    55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
237
- * 
240
+ *
238 241
  *  1047 : Pt1000 with 4k7 pullup
239 242
  *  1010 : Pt1000 with 1k pullup (non standard)
240 243
  *   147 : Pt100 with 4k7 pullup
@@ -520,26 +523,31 @@
520 523
  *
521 524
  * These settings can be reset by M502
522 525
  *
526
+ * You can set distinct factors for each E stepper, if needed.
527
+ * If fewer factors are given, the last will apply to the rest.
528
+ *
523 529
  * Note that if EEPROM is enabled, saved values will override these.
524 530
  */
525 531
 
526 532
 /**
527 533
  * Default Axis Steps Per Unit (steps/mm)
528 534
  * Override with M92
535
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
529 536
  */
530 537
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 72.9, 72.9, 72.9, 291 }  // default steps per unit for BI v2.5 (cable drive)
531 538
 
532 539
 /**
533 540
  * Default Max Feed Rate (mm/s)
534 541
  * Override with M203
542
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
535 543
  */
536 544
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 500, 150 }
537 545
 
538 546
 /**
539 547
  * Default Max Acceleration (change/s) change = mm/s
548
+ * (Maximum start speed for accelerated moves)
540 549
  * Override with M201
541
- *
542
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
550
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
543 551
  */
544 552
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 9000, 10000 }
545 553
 

+ 11
- 3
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -520,26 +523,31 @@
520 523
  *
521 524
  * These settings can be reset by M502
522 525
  *
526
+ * You can set distinct factors for each E stepper, if needed.
527
+ * If fewer factors are given, the last will apply to the rest.
528
+ *
523 529
  * Note that if EEPROM is enabled, saved values will override these.
524 530
  */
525 531
 
526 532
 /**
527 533
  * Default Axis Steps Per Unit (steps/mm)
528 534
  * Override with M92
535
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
529 536
  */
530
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {80, 80, 80, 760*1.1}  // default steps per unit for Kossel (GT2, 20 tooth)
537
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 80, 760*1.1 }  // default steps per unit for Kossel (GT2, 20 tooth)
531 538
 
532 539
 /**
533 540
  * Default Max Feed Rate (mm/s)
534 541
  * Override with M203
542
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
535 543
  */
536 544
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 500, 25 }
537 545
 
538 546
 /**
539 547
  * Default Max Acceleration (change/s) change = mm/s
548
+ * (Maximum start speed for accelerated moves)
540 549
  * Override with M201
541
- *
542
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
550
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
543 551
  */
544 552
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 9000, 10000 }
545 553
 

+ 11
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -520,26 +523,31 @@
520 523
  *
521 524
  * These settings can be reset by M502
522 525
  *
526
+ * You can set distinct factors for each E stepper, if needed.
527
+ * If fewer factors are given, the last will apply to the rest.
528
+ *
523 529
  * Note that if EEPROM is enabled, saved values will override these.
524 530
  */
525 531
 
526 532
 /**
527 533
  * Default Axis Steps Per Unit (steps/mm)
528 534
  * Override with M92
535
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
529 536
  */
530
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {80, 80, 80, 760*1.1}  // default steps per unit for Kossel (GT2, 20 tooth)
537
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 80, 760*1.1 }  // default steps per unit for Kossel (GT2, 20 tooth)
531 538
 
532 539
 /**
533 540
  * Default Max Feed Rate (mm/s)
534 541
  * Override with M203
542
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
535 543
  */
536 544
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 500, 25 }
537 545
 
538 546
 /**
539 547
  * Default Max Acceleration (change/s) change = mm/s
548
+ * (Maximum start speed for accelerated moves)
540 549
  * Override with M201
541
- *
542
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
550
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
543 551
  */
544 552
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 9000, 10000 }
545 553
 

+ 11
- 3
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -149,6 +149,9 @@
149 149
 // :[1, 2, 3, 4]
150 150
 #define EXTRUDERS 1
151 151
 
152
+// Enable if your E steppers or extruder gear ratios are not identical
153
+//#define DISTINCT_E_FACTORS
154
+
152 155
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
153 156
 //#define SINGLENOZZLE
154 157
 
@@ -514,26 +517,31 @@
514 517
  *
515 518
  * These settings can be reset by M502
516 519
  *
520
+ * You can set distinct factors for each E stepper, if needed.
521
+ * If fewer factors are given, the last will apply to the rest.
522
+ *
517 523
  * Note that if EEPROM is enabled, saved values will override these.
518 524
  */
519 525
 
520 526
 /**
521 527
  * Default Axis Steps Per Unit (steps/mm)
522 528
  * Override with M92
529
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
523 530
  */
524
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 184.8}
531
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 184.8 }
525 532
 
526 533
 /**
527 534
  * Default Max Feed Rate (mm/s)
528 535
  * Override with M203
536
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
529 537
  */
530 538
 #define DEFAULT_MAX_FEEDRATE          { 200, 200, 200, 200 }
531 539
 
532 540
 /**
533 541
  * Default Max Acceleration (change/s) change = mm/s
542
+ * (Maximum start speed for accelerated moves)
534 543
  * Override with M201
535
- *
536
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
544
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
537 545
  */
538 546
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 9000, 9000 }
539 547
 

+ 11
- 3
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -138,6 +138,9 @@
138 138
 // :[1, 2, 3, 4]
139 139
 #define EXTRUDERS 1
140 140
 
141
+// Enable if your E steppers or extruder gear ratios are not identical
142
+//#define DISTINCT_E_FACTORS
143
+
141 144
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
142 145
 //#define SINGLENOZZLE
143 146
 
@@ -526,26 +529,31 @@
526 529
  *
527 530
  * These settings can be reset by M502
528 531
  *
532
+ * You can set distinct factors for each E stepper, if needed.
533
+ * If fewer factors are given, the last will apply to the rest.
534
+ *
529 535
  * Note that if EEPROM is enabled, saved values will override these.
530 536
  */
531 537
 
532 538
 /**
533 539
  * Default Axis Steps Per Unit (steps/mm)
534 540
  * Override with M92
541
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
535 542
  */
536
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158}   // default steps per unit for PowerWasp
543
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158 }   // default steps per unit for PowerWasp
537 544
 
538 545
 /**
539 546
  * Default Max Feed Rate (mm/s)
540 547
  * Override with M203
548
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
541 549
  */
542 550
 #define DEFAULT_MAX_FEEDRATE          { 200, 200, 200, 25 }
543 551
 
544 552
 /**
545 553
  * Default Max Acceleration (change/s) change = mm/s
554
+ * (Maximum start speed for accelerated moves)
546 555
  * Override with M201
547
- *
548
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
556
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
549 557
  */
550 558
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 9000, 10000 }
551 559
 

+ 10
- 2
Marlin/example_configurations/makibox/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -475,26 +478,31 @@
475 478
  *
476 479
  * These settings can be reset by M502
477 480
  *
481
+ * You can set distinct factors for each E stepper, if needed.
482
+ * If fewer factors are given, the last will apply to the rest.
483
+ *
478 484
  * Note that if EEPROM is enabled, saved values will override these.
479 485
  */
480 486
 
481 487
 /**
482 488
  * Default Axis Steps Per Unit (steps/mm)
483 489
  * Override with M92
490
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
484 491
  */
485 492
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 400, 400, 400, 163 }     // default steps per unit for ***** MakiBox A6 *****
486 493
 
487 494
 /**
488 495
  * Default Max Feed Rate (mm/s)
489 496
  * Override with M203
497
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
490 498
  */
491 499
 #define DEFAULT_MAX_FEEDRATE          { 60, 60, 20, 45 }
492 500
 
493 501
 /**
494 502
  * Default Max Acceleration (change/s) change = mm/s
503
+ * (Maximum start speed for accelerated moves)
495 504
  * Override with M201
496
- *
497
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
505
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
498 506
  */
499 507
 #define DEFAULT_MAX_ACCELERATION      { 2000, 2000, 30, 10000 }
500 508
 

+ 11
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -145,6 +145,9 @@
145 145
 // :[1, 2, 3, 4]
146 146
 #define EXTRUDERS 1
147 147
 
148
+// Enable if your E steppers or extruder gear ratios are not identical
149
+//#define DISTINCT_E_FACTORS
150
+
148 151
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
149 152
 //#define SINGLENOZZLE
150 153
 
@@ -462,30 +465,35 @@
462 465
  *
463 466
  * These settings can be reset by M502
464 467
  *
468
+ * You can set distinct factors for each E stepper, if needed.
469
+ * If fewer factors are given, the last will apply to the rest.
470
+ *
465 471
  * Note that if EEPROM is enabled, saved values will override these.
466 472
  */
467 473
 
468 474
 /**
469 475
  * Default Axis Steps Per Unit (steps/mm)
470 476
  * Override with M92
477
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
471 478
  */
472 479
 #define DEFAULT_AXIS_STEPS_PER_UNIT   { 71.1, 71.1, 2560, 600 } // David TVRR
473 480
 
474
-//#define DEFAULT_AXIS_STEPS_PER_UNIT   {79.87, 79.87, 2566, 563,78} // Al's TVRR
481
+//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 79.87, 79.87, 2566, 563.78 } // Al's TVRR
475 482
 //#define DEFAULT_AXIS_STEPS_PER_UNIT   { 81.26, 80.01, 2561, 599.14 } // Michel TVRR old
476 483
 //#define DEFAULT_AXIS_STEPS_PER_UNIT   { 71.1, 71.1, 2560, 739.65 } // Michel TVRR
477 484
 
478 485
 /**
479 486
  * Default Max Feed Rate (mm/s)
480 487
  * Override with M203
488
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
481 489
  */
482 490
 #define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 45 } // David TVRR
483 491
 
484 492
 /**
485 493
  * Default Max Acceleration (change/s) change = mm/s
494
+ * (Maximum start speed for accelerated moves)
486 495
  * Override with M201
487
- *
488
- * Maximum start speed for accelerated moves: { X, Y, Z, E }
496
+ *                                      X, Y, Z, E0 [, E1[, E2[, E3]]]
489 497
  */
490 498
 #define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 10000 }
491 499
 

+ 63
- 35
Marlin/planner.cpp View File

@@ -78,15 +78,19 @@ Planner planner;
78 78
  * A ring buffer of moves described in steps
79 79
  */
80 80
 block_t Planner::block_buffer[BLOCK_BUFFER_SIZE];
81
-volatile uint8_t Planner::block_buffer_head = 0;           // Index of the next block to be pushed
82
-volatile uint8_t Planner::block_buffer_tail = 0;
81
+volatile uint8_t Planner::block_buffer_head = 0,           // Index of the next block to be pushed
82
+                 Planner::block_buffer_tail = 0;
83 83
 
84
-float Planner::max_feedrate_mm_s[NUM_AXIS], // Max speeds in mm per second
85
-      Planner::axis_steps_per_mm[NUM_AXIS],
86
-      Planner::steps_to_mm[NUM_AXIS];
84
+float Planner::max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second
85
+      Planner::axis_steps_per_mm[XYZE_N],
86
+      Planner::steps_to_mm[XYZE_N];
87 87
 
88
-uint32_t Planner::max_acceleration_steps_per_s2[NUM_AXIS],
89
-         Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
88
+#if ENABLED(DISTINCT_E_FACTORS)
89
+  uint8_t Planner::last_extruder = 0;     // Respond to extruder change
90
+#endif
91
+
92
+uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
93
+         Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
90 94
 
91 95
 millis_t Planner::min_segment_time;
92 96
 float Planner::min_feedrate_mm_s,
@@ -650,9 +654,17 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
650 654
     lround(a * axis_steps_per_mm[X_AXIS]),
651 655
     lround(b * axis_steps_per_mm[Y_AXIS]),
652 656
     lround(c * axis_steps_per_mm[Z_AXIS]),
653
-    lround(e * axis_steps_per_mm[E_AXIS])
657
+    lround(e * axis_steps_per_mm[E_AXIS_N])
654 658
   };
655
-  
659
+
660
+  // When changing extruders recalculate steps corresponding to the E position
661
+  #if ENABLED(DISTINCT_E_FACTORS)
662
+    if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
663
+      position[E_AXIS] = lround(position[E_AXIS] * axis_steps_per_mm[E_AXIS_N] * steps_to_mm[E_AXIS + last_extruder]);
664
+      last_extruder = extruder;
665
+    }
666
+  #endif
667
+
656 668
   #if ENABLED(LIN_ADVANCE)
657 669
     float target_float[XYZE] = {a, b, c, e};
658 670
     float de_float = target_float[E_AXIS] - position_float[E_AXIS];
@@ -702,7 +714,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
702 714
         SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
703 715
       }
704 716
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
705
-        if (labs(de) > (int32_t)axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
717
+        if (labs(de) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
706 718
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
707 719
           de = 0; // no difference
708 720
           SERIAL_ECHO_START;
@@ -941,7 +953,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
941 953
     delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
942 954
     delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS];
943 955
   #endif
944
-  delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS];
956
+  delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS_N];
945 957
 
946 958
   if (block->steps[X_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Y_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Z_AXIS] < MIN_STEPS_PER_SEGMENT) {
947 959
     block->millimeters = fabs(delta_mm[E_AXIS]);
@@ -1091,16 +1103,16 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1091 1103
     accel = ceil(retract_acceleration * steps_per_mm);
1092 1104
   }
1093 1105
   else {
1094
-    #define LIMIT_ACCEL_LONG(AXIS) do{ \
1095
-      if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS] < accel) { \
1096
-        const uint32_t comp = max_acceleration_steps_per_s2[AXIS] * block->step_event_count; \
1106
+    #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \
1107
+      if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \
1108
+        const uint32_t comp = max_acceleration_steps_per_s2[AXIS+INDX] * block->step_event_count; \
1097 1109
         if (accel * block->steps[AXIS] > comp) accel = comp / block->steps[AXIS]; \
1098 1110
       } \
1099 1111
     }while(0)
1100 1112
 	
1101
-    #define LIMIT_ACCEL_FLOAT(AXIS) do{ \
1102
-      if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS] < accel) { \
1103
-        const float comp = (float)max_acceleration_steps_per_s2[AXIS] * (float)block->step_event_count; \
1113
+    #define LIMIT_ACCEL_FLOAT(AXIS,INDX) do{ \
1114
+      if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \
1115
+        const float comp = (float)max_acceleration_steps_per_s2[AXIS+INDX] * (float)block->step_event_count; \
1104 1116
         if ((float)accel * (float)block->steps[AXIS] > comp) accel = comp / (float)block->steps[AXIS]; \
1105 1117
       } \
1106 1118
     }while(0)
@@ -1109,16 +1121,17 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1109 1121
     accel = ceil((esteps ? acceleration : travel_acceleration) * steps_per_mm);
1110 1122
 
1111 1123
     // Limit acceleration per axis
1112
-    if (block->step_event_count <= cutoff_long){
1113
-      LIMIT_ACCEL_LONG(X_AXIS);
1114
-      LIMIT_ACCEL_LONG(Y_AXIS);
1115
-      LIMIT_ACCEL_LONG(Z_AXIS);
1116
-      LIMIT_ACCEL_LONG(E_AXIS);
1117
-    } else {
1118
-      LIMIT_ACCEL_FLOAT(X_AXIS);
1119
-      LIMIT_ACCEL_FLOAT(Y_AXIS);
1120
-      LIMIT_ACCEL_FLOAT(Z_AXIS);
1121
-      LIMIT_ACCEL_FLOAT(E_AXIS);
1124
+    if (block->step_event_count <= cutoff_long) {
1125
+      LIMIT_ACCEL_LONG(X_AXIS,0);
1126
+      LIMIT_ACCEL_LONG(Y_AXIS,0);
1127
+      LIMIT_ACCEL_LONG(Z_AXIS,0);
1128
+      LIMIT_ACCEL_LONG(E_AXIS,extruder);
1129
+    }
1130
+    else {
1131
+      LIMIT_ACCEL_FLOAT(X_AXIS,0);
1132
+      LIMIT_ACCEL_FLOAT(Y_AXIS,0);
1133
+      LIMIT_ACCEL_FLOAT(Z_AXIS,0);
1134
+      LIMIT_ACCEL_FLOAT(E_AXIS,extruder);
1122 1135
     }
1123 1136
   }
1124 1137
   block->acceleration_steps_per_s2 = accel;
@@ -1302,7 +1315,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1302 1315
     }
1303 1316
     else {
1304 1317
       block->use_advance_lead = true;
1305
-      block->abs_adv_steps_multiplier8 = lround(extruder_advance_k * (de_float / mm_D_float) * block->nominal_speed / (float)block->nominal_rate * axis_steps_per_mm[E_AXIS] * 256.0);
1318
+      block->abs_adv_steps_multiplier8 = lround(extruder_advance_k * (de_float / mm_D_float) * block->nominal_speed / (float)block->nominal_rate * axis_steps_per_mm[E_AXIS_N] * 256.0);
1306 1319
     }
1307 1320
 
1308 1321
   #elif ENABLED(ADVANCE)
@@ -1350,13 +1363,18 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1350 1363
  */
1351 1364
 
1352 1365
 void Planner::_set_position_mm(const float &a, const float &b, const float &c, const float &e) {
1366
+  #if ENABLED(DISTINCT_E_FACTORS)
1367
+    #define _EINDEX (E_AXIS + active_extruder)
1368
+    last_extruder = active_extruder;
1369
+  #else
1370
+    #define _EINDEX E_AXIS
1371
+  #endif
1353 1372
   long na = position[X_AXIS] = lround(a * axis_steps_per_mm[X_AXIS]),
1354 1373
        nb = position[Y_AXIS] = lround(b * axis_steps_per_mm[Y_AXIS]),
1355 1374
        nc = position[Z_AXIS] = lround(c * axis_steps_per_mm[Z_AXIS]),
1356
-       ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
1375
+       ne = position[E_AXIS] = lround(e * axis_steps_per_mm[_EINDEX]);
1357 1376
   stepper.set_position(na, nb, nc, ne);
1358 1377
   previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
1359
-
1360 1378
   ZERO(previous_speed);
1361 1379
 }
1362 1380
 
@@ -1375,7 +1393,6 @@ void Planner::set_position_mm_kinematic(const float position[NUM_AXIS]) {
1375 1393
   #endif
1376 1394
 }
1377 1395
 
1378
-
1379 1396
 /**
1380 1397
  * Sync from the stepper positions. (e.g., after an interrupted move)
1381 1398
  */
@@ -1387,24 +1404,35 @@ void Planner::sync_from_steppers() {
1387 1404
  * Setters for planner position (also setting stepper position).
1388 1405
  */
1389 1406
 void Planner::set_position_mm(const AxisEnum axis, const float& v) {
1390
-  position[axis] = lround(v * axis_steps_per_mm[axis]);
1407
+  #if ENABLED(DISTINCT_E_FACTORS)
1408
+    const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1409
+    last_extruder = active_extruder;
1410
+  #else
1411
+    const uint8_t axis_index = axis;
1412
+  #endif
1413
+  position[axis] = lround(v * axis_steps_per_mm[axis_index]);
1391 1414
   stepper.set_position(axis, v);
1392 1415
   previous_speed[axis] = 0.0;
1393 1416
 }
1394 1417
 
1395 1418
 // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2
1396 1419
 void Planner::reset_acceleration_rates() {
1420
+  #if ENABLED(DISTINCT_E_FACTORS)
1421
+    #define HIGHEST_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder)
1422
+  #else
1423
+    #define HIGHEST_CONDITION true
1424
+  #endif
1397 1425
   uint32_t highest_rate = 1;
1398
-  LOOP_XYZE(i) {
1426
+  LOOP_XYZE_N(i) {
1399 1427
     max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i];
1400
-    NOLESS(highest_rate, max_acceleration_steps_per_s2[i]);
1428
+    if (HIGHEST_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]);
1401 1429
   }
1402 1430
   cutoff_long = 4294967295UL / highest_rate;
1403 1431
 }
1404 1432
 
1405 1433
 // Recalculate position, steps_to_mm if axis_steps_per_mm changes!
1406 1434
 void Planner::refresh_positioning() {
1407
-  LOOP_XYZE(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i];
1435
+  LOOP_XYZE_N(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i];
1408 1436
   set_position_mm_kinematic(current_position);
1409 1437
   reset_acceleration_rates();
1410 1438
 }

+ 24
- 14
Marlin/planner.h View File

@@ -140,22 +140,26 @@ class Planner {
140 140
      * A ring buffer of moves described in steps
141 141
      */
142 142
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
143
-    static volatile uint8_t block_buffer_head;           // Index of the next block to be pushed
144
-    static volatile uint8_t block_buffer_tail;
143
+    static volatile uint8_t block_buffer_head,  // Index of the next block to be pushed
144
+                            block_buffer_tail;
145 145
 
146
-    static float max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second
147
-    static float axis_steps_per_mm[NUM_AXIS];
148
-    static float steps_to_mm[NUM_AXIS];
149
-    static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
150
-    static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
146
+    #if ENABLED(DISTINCT_E_FACTORS)
147
+      static uint8_t last_extruder;             // Respond to extruder change
148
+    #endif
149
+
150
+    static float max_feedrate_mm_s[XYZE_N],     // Max speeds in mm per second
151
+                 axis_steps_per_mm[XYZE_N],
152
+                 steps_to_mm[XYZE_N];
153
+    static unsigned long max_acceleration_steps_per_s2[XYZE_N],
154
+                         max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
151 155
 
152 156
     static millis_t min_segment_time;
153
-    static float min_feedrate_mm_s;
154
-    static float acceleration;         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
155
-    static float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
156
-    static float travel_acceleration;  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
157
-    static float max_jerk[XYZE];       // The largest speed change requiring no acceleration
158
-    static float min_travel_feedrate_mm_s;
157
+    static float min_feedrate_mm_s,
158
+                 acceleration,         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
159
+                 retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
160
+                 travel_acceleration,  // Travel acceleration mm/s^2  DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
161
+                 max_jerk[XYZE],       // The largest speed change requiring no acceleration
162
+                 min_travel_feedrate_mm_s;
159 163
 
160 164
     #if HAS_ABL
161 165
       static bool abl_enabled;            // Flag that bed leveling is enabled
@@ -343,7 +347,13 @@ class Planner {
343 347
     static void set_position_mm_kinematic(const float position[NUM_AXIS]);
344 348
     static void set_position_mm(const AxisEnum axis, const float &v);
345 349
     static FORCE_INLINE void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); }
346
-    static FORCE_INLINE void set_e_position_mm(const float &e) { set_position_mm(E_AXIS, e); }
350
+    static FORCE_INLINE void set_e_position_mm(const float &e) {
351
+      set_position_mm(E_AXIS
352
+        #if ENABLED(DISTINCT_E_FACTORS)
353
+          + active_extruder
354
+        #endif
355
+      , e);
356
+    }
347 357
 
348 358
     /**
349 359
      * Sync from the stepper positions. (e.g., after an interrupted move)

+ 85
- 3
Marlin/ultralcd.cpp View File

@@ -1850,7 +1850,35 @@ void kill_screen(const char* lcd_msg) {
1850 1850
   void lcd_control_temperature_preheat_material2_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); }
1851 1851
 
1852 1852
   void _reset_acceleration_rates() { planner.reset_acceleration_rates(); }
1853
+  #if ENABLED(DISTINCT_E_FACTORS)
1854
+    void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); }
1855
+    void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); }
1856
+    void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); }
1857
+    #if E_STEPPERS > 2
1858
+      void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); }
1859
+      #if E_STEPPERS > 3
1860
+        void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); }
1861
+      #endif
1862
+    #endif
1863
+  #endif
1864
+
1853 1865
   void _planner_refresh_positioning() { planner.refresh_positioning(); }
1866
+  #if ENABLED(DISTINCT_E_FACTORS)
1867
+    void _planner_refresh_e_positioning(const uint8_t e) {
1868
+      if (e == active_extruder)
1869
+        _planner_refresh_positioning();
1870
+      else
1871
+        planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i];
1872
+    }
1873
+    void _planner_refresh_e0_positioning() { _reset_e_acceleration_rate(0); }
1874
+    void _planner_refresh_e1_positioning() { _reset_e_acceleration_rate(1); }
1875
+    #if E_STEPPERS > 2
1876
+      void _planner_refresh_e2_positioning() { _reset_e_acceleration_rate(2); }
1877
+      #if E_STEPPERS > 3
1878
+        void _planner_refresh_e3_positioning() { _reset_e_acceleration_rate(3); }
1879
+      #endif
1880
+    #endif
1881
+  #endif
1854 1882
 
1855 1883
   /**
1856 1884
    *
@@ -1876,22 +1904,76 @@ void kill_screen(const char* lcd_msg) {
1876 1904
       MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_jerk[Z_AXIS], 0.1, 990);
1877 1905
     #endif
1878 1906
     MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990);
1907
+
1908
+    //
1909
+    // M203 Settings
1910
+    //
1879 1911
     MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999);
1880 1912
     MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999);
1881 1913
     MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999);
1882
-    MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
1914
+
1915
+    #if ENABLED(DISTINCT_E_FACTORS)
1916
+      MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999);
1917
+      MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
1918
+      MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.max_feedrate_mm_s[E_AXIS + 1], 1, 999);
1919
+      #if E_STEPPERS > 2
1920
+        MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 2], 1, 999);
1921
+        #if E_STEPPERS > 3
1922
+          MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 3], 1, 999);
1923
+        #endif
1924
+      #endif
1925
+    #else
1926
+      MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
1927
+    #endif
1928
+
1883 1929
     MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999);
1884 1930
     MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999);
1931
+
1932
+    //
1933
+    // M201 Settings
1934
+    //
1885 1935
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
1886 1936
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1887 1937
     MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
1888
-    MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
1938
+
1939
+    #if ENABLED(DISTINCT_E_FACTORS)
1940
+      MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates);
1941
+      MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate);
1942
+      MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate);
1943
+      #if E_STEPPERS > 2
1944
+        MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate);
1945
+        #if E_STEPPERS > 3
1946
+          MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate);
1947
+        #endif
1948
+      #endif
1949
+    #else
1950
+      MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
1951
+    #endif
1952
+
1889 1953
     MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000);
1890 1954
     MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000);
1955
+
1956
+    //
1957
+    // M92 Settings
1958
+    //
1891 1959
     MENU_ITEM_EDIT_CALLBACK(float62, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning);
1892 1960
     MENU_ITEM_EDIT_CALLBACK(float62, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning);
1893 1961
     MENU_ITEM_EDIT_CALLBACK(float62, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning);
1894
-    MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
1962
+
1963
+    #if ENABLED(DISTINCT_E_FACTORS)
1964
+      MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning);
1965
+      MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS MSG_E1, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning);
1966
+      MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS MSG_E2, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning);
1967
+      #if E_STEPPERS > 2
1968
+        MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS MSG_E3, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning);
1969
+        #if E_STEPPERS > 3
1970
+          MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS MSG_E4, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning);
1971
+        #endif
1972
+      #endif
1973
+    #else
1974
+      MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
1975
+    #endif
1976
+
1895 1977
     #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
1896 1978
       MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
1897 1979
     #endif

Loading…
Cancel
Save