浏览代码

[2.0.x] LIN_ADVANCE v1.5 (#9712)

Scott Lahteine 7 年前
父节点
当前提交
2bd252b501
没有帐户链接到提交者的电子邮件
共有 52 个文件被更改,包括 885 次插入1666 次删除
  1. 14
    32
      Marlin/Configuration_adv.h
  2. 14
    32
      Marlin/src/config/default/Configuration_adv.h
  3. 14
    32
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  4. 14
    32
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  5. 14
    32
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  6. 14
    32
      Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h
  7. 14
    32
      Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h
  8. 14
    32
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  9. 14
    32
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  10. 14
    32
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  11. 14
    32
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  12. 14
    32
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  13. 14
    32
      Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h
  14. 14
    32
      Marlin/src/config/examples/Creality/Ender/Configuration_adv.h
  15. 14
    32
      Marlin/src/config/examples/Felix/Configuration_adv.h
  16. 14
    32
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  17. 14
    32
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  18. 14
    32
      Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h
  19. 14
    32
      Marlin/src/config/examples/MakerParts/Configuration_adv.h
  20. 14
    32
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  21. 14
    32
      Marlin/src/config/examples/Malyan/M200/Configuration_adv.h
  22. 14
    32
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  23. 14
    32
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  24. 14
    32
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  25. 14
    32
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  26. 14
    32
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  27. 14
    32
      Marlin/src/config/examples/TheBorg/Configuration_adv.h
  28. 14
    32
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  29. 14
    32
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  30. 14
    32
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  31. 14
    32
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  32. 14
    32
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  33. 14
    32
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  34. 14
    32
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h
  35. 14
    32
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  36. 14
    32
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  37. 14
    32
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  38. 14
    32
      Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h
  39. 14
    32
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  40. 14
    32
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  41. 14
    32
      Marlin/src/config/examples/makibox/Configuration_adv.h
  42. 14
    32
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  43. 14
    32
      Marlin/src/config/examples/wt150/Configuration_adv.h
  44. 7
    22
      Marlin/src/gcode/feature/advance/M900.cpp
  45. 0
    6
      Marlin/src/inc/Conditionals_LCD.h
  46. 2
    4
      Marlin/src/inc/SanityCheck.h
  47. 2
    2
      Marlin/src/lcd/ultralcd.cpp
  48. 8
    15
      Marlin/src/module/configuration_store.cpp
  49. 126
    102
      Marlin/src/module/planner.cpp
  50. 13
    6
      Marlin/src/module/planner.h
  51. 99
    107
      Marlin/src/module/stepper.cpp
  52. 26
    26
      Marlin/src/module/stepper.h

+ 14
- 32
Marlin/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/default/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Anet/A6/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Anet/A8/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h 查看文件

712
 // @section extruder
712
 // @section extruder
713
 
713
 
714
 /**
714
 /**
715
- * Implementation of linear pressure control
715
+ * Linear Pressure Control v1.5
716
  *
716
  *
717
- * Assumption: advance = k * (delta velocity)
717
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
718
  * K=0 means advance disabled.
718
  * K=0 means advance disabled.
719
- * See Marlin documentation for calibration instructions.
719
+ *
720
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
721
+ *
722
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
723
+ * Larger K values will be needed for flexible filament and greater distances.
724
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
725
+ * print acceleration will be reduced during the affected moves to keep within the limit.
726
+ *
727
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
728
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
720
  */
729
  */
721
 //#define LIN_ADVANCE
730
 //#define LIN_ADVANCE
722
-
723
 #if ENABLED(LIN_ADVANCE)
731
 #if ENABLED(LIN_ADVANCE)
724
-  #define LIN_ADVANCE_K 75
725
-
726
-  /**
727
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
728
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
729
-   * While this is harmless for normal printing (the fluid nature of the filament will
730
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
731
-   *
732
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
733
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
734
-   * if the slicer is using variable widths or layer heights within one print!
735
-   *
736
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
737
-   *
738
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
739
-   *   - W is the extrusion width in mm
740
-   *   - H is the layer height in mm
741
-   *   - D is the filament diameter in mm
742
-   *
743
-   * Example: `M900 R0.0458` to set the ratio directly.
744
-   *
745
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
746
-   *
747
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
748
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
749
-   */
750
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
751
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
732
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
733
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
752
 #endif
734
 #endif
753
 
735
 
754
 // @section leveling
736
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/BIBO/TouchX/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Cartesio/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Creality/Ender/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Felix/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/MakerParts/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Malyan/M200/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h 查看文件

719
 // @section extruder
719
 // @section extruder
720
 
720
 
721
 /**
721
 /**
722
- * Implementation of linear pressure control
722
+ * Linear Pressure Control v1.5
723
  *
723
  *
724
- * Assumption: advance = k * (delta velocity)
724
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
725
  * K=0 means advance disabled.
725
  * K=0 means advance disabled.
726
- * See Marlin documentation for calibration instructions.
726
+ *
727
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
728
+ *
729
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
730
+ * Larger K values will be needed for flexible filament and greater distances.
731
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
732
+ * print acceleration will be reduced during the affected moves to keep within the limit.
733
+ *
734
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
735
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
727
  */
736
  */
728
 //#define LIN_ADVANCE
737
 //#define LIN_ADVANCE
729
-
730
 #if ENABLED(LIN_ADVANCE)
738
 #if ENABLED(LIN_ADVANCE)
731
-  #define LIN_ADVANCE_K 75
732
-
733
-  /**
734
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
735
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
736
-   * While this is harmless for normal printing (the fluid nature of the filament will
737
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
738
-   *
739
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
740
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
741
-   * if the slicer is using variable widths or layer heights within one print!
742
-   *
743
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
744
-   *
745
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
746
-   *   - W is the extrusion width in mm
747
-   *   - H is the layer height in mm
748
-   *   - D is the filament diameter in mm
749
-   *
750
-   * Example: `M900 R0.0458` to set the ratio directly.
751
-   *
752
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
753
-   *
754
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
755
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
756
-   */
757
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
758
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
739
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
740
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
759
 #endif
741
 #endif
760
 
742
 
761
 // @section leveling
743
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/RigidBot/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/SCARA/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/TheBorg/Configuration_adv.h 查看文件

708
 // @section extruder
708
 // @section extruder
709
 
709
 
710
 /**
710
 /**
711
- * Implementation of linear pressure control
711
+ * Linear Pressure Control v1.5
712
  *
712
  *
713
- * Assumption: advance = k * (delta velocity)
713
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
714
  * K=0 means advance disabled.
714
  * K=0 means advance disabled.
715
- * See Marlin documentation for calibration instructions.
715
+ *
716
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
717
+ *
718
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
719
+ * Larger K values will be needed for flexible filament and greater distances.
720
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
721
+ * print acceleration will be reduced during the affected moves to keep within the limit.
722
+ *
723
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
724
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
716
  */
725
  */
717
 //#define LIN_ADVANCE
726
 //#define LIN_ADVANCE
718
-
719
 #if ENABLED(LIN_ADVANCE)
727
 #if ENABLED(LIN_ADVANCE)
720
-  #define LIN_ADVANCE_K 75
721
-
722
-  /**
723
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
724
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
725
-   * While this is harmless for normal printing (the fluid nature of the filament will
726
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
727
-   *
728
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
729
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
730
-   * if the slicer is using variable widths or layer heights within one print!
731
-   *
732
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
733
-   *
734
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
735
-   *   - W is the extrusion width in mm
736
-   *   - H is the layer height in mm
737
-   *   - D is the filament diameter in mm
738
-   *
739
-   * Example: `M900 R0.0458` to set the ratio directly.
740
-   *
741
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
742
-   *
743
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
744
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
745
-   */
746
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
747
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
728
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
729
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
748
 #endif
730
 #endif
749
 
731
 
750
 // @section leveling
732
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h 查看文件

724
 // @section extruder
724
 // @section extruder
725
 
725
 
726
 /**
726
 /**
727
- * Implementation of linear pressure control
727
+ * Linear Pressure Control v1.5
728
  *
728
  *
729
- * Assumption: advance = k * (delta velocity)
729
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
730
  * K=0 means advance disabled.
730
  * K=0 means advance disabled.
731
- * See Marlin documentation for calibration instructions.
731
+ *
732
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
733
+ *
734
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
735
+ * Larger K values will be needed for flexible filament and greater distances.
736
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
737
+ * print acceleration will be reduced during the affected moves to keep within the limit.
738
+ *
739
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
740
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
732
  */
741
  */
733
 //#define LIN_ADVANCE
742
 //#define LIN_ADVANCE
734
-
735
 #if ENABLED(LIN_ADVANCE)
743
 #if ENABLED(LIN_ADVANCE)
736
-  #define LIN_ADVANCE_K 140 // start value for PLA on K8200
737
-
738
-  /**
739
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
740
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
741
-   * While this is harmless for normal printing (the fluid nature of the filament will
742
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
743
-   *
744
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
745
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
746
-   * if the slicer is using variable widths or layer heights within one print!
747
-   *
748
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
749
-   *
750
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
751
-   *   - W is the extrusion width in mm
752
-   *   - H is the layer height in mm
753
-   *   - D is the filament diameter in mm
754
-   *
755
-   * Example: `M900 R0.0458` to set the ratio directly.
756
-   *
757
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
758
-   *
759
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
760
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
761
-   */
762
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
763
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
744
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
745
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
764
 #endif
746
 #endif
765
 
747
 
766
 // @section leveling
748
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 #define LIN_ADVANCE
731
 #define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 0
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0     // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/generic/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h 查看文件

718
 // @section extruder
718
 // @section extruder
719
 
719
 
720
 /**
720
 /**
721
- * Implementation of linear pressure control
721
+ * Linear Pressure Control v1.5
722
  *
722
  *
723
- * Assumption: advance = k * (delta velocity)
723
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
724
  * K=0 means advance disabled.
724
  * K=0 means advance disabled.
725
- * See Marlin documentation for calibration instructions.
725
+ *
726
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
727
+ *
728
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
729
+ * Larger K values will be needed for flexible filament and greater distances.
730
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
731
+ * print acceleration will be reduced during the affected moves to keep within the limit.
732
+ *
733
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
734
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
726
  */
735
  */
727
 //#define LIN_ADVANCE
736
 //#define LIN_ADVANCE
728
-
729
 #if ENABLED(LIN_ADVANCE)
737
 #if ENABLED(LIN_ADVANCE)
730
-  #define LIN_ADVANCE_K 75
731
-
732
-  /**
733
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
734
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
735
-   * While this is harmless for normal printing (the fluid nature of the filament will
736
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
737
-   *
738
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
739
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
740
-   * if the slicer is using variable widths or layer heights within one print!
741
-   *
742
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
743
-   *
744
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
745
-   *   - W is the extrusion width in mm
746
-   *   - H is the layer height in mm
747
-   *   - D is the filament diameter in mm
748
-   *
749
-   * Example: `M900 R0.0458` to set the ratio directly.
750
-   *
751
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
752
-   *
753
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
754
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
755
-   */
756
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
757
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
738
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
739
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
758
 #endif
740
 #endif
759
 
741
 
760
 // @section leveling
742
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h 查看文件

713
 // @section extruder
713
 // @section extruder
714
 
714
 
715
 /**
715
 /**
716
- * Implementation of linear pressure control
716
+ * Linear Pressure Control v1.5
717
  *
717
  *
718
- * Assumption: advance = k * (delta velocity)
718
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
719
  * K=0 means advance disabled.
719
  * K=0 means advance disabled.
720
- * See Marlin documentation for calibration instructions.
720
+ *
721
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
722
+ *
723
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
724
+ * Larger K values will be needed for flexible filament and greater distances.
725
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
726
+ * print acceleration will be reduced during the affected moves to keep within the limit.
727
+ *
728
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
729
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
721
  */
730
  */
722
 //#define LIN_ADVANCE
731
 //#define LIN_ADVANCE
723
-
724
 #if ENABLED(LIN_ADVANCE)
732
 #if ENABLED(LIN_ADVANCE)
725
-  #define LIN_ADVANCE_K 75
726
-
727
-  /**
728
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
729
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
730
-   * While this is harmless for normal printing (the fluid nature of the filament will
731
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
732
-   *
733
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
734
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
735
-   * if the slicer is using variable widths or layer heights within one print!
736
-   *
737
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
738
-   *
739
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
740
-   *   - W is the extrusion width in mm
741
-   *   - H is the layer height in mm
742
-   *   - D is the filament diameter in mm
743
-   *
744
-   * Example: `M900 R0.0458` to set the ratio directly.
745
-   *
746
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
747
-   *
748
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
749
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
750
-   */
751
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
752
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
733
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
734
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
753
 #endif
735
 #endif
754
 
736
 
755
 // @section leveling
737
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/makibox/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h 查看文件

711
 // @section extruder
711
 // @section extruder
712
 
712
 
713
 /**
713
 /**
714
- * Implementation of linear pressure control
714
+ * Linear Pressure Control v1.5
715
  *
715
  *
716
- * Assumption: advance = k * (delta velocity)
716
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
717
  * K=0 means advance disabled.
717
  * K=0 means advance disabled.
718
- * See Marlin documentation for calibration instructions.
718
+ *
719
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
720
+ *
721
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
722
+ * Larger K values will be needed for flexible filament and greater distances.
723
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
724
+ * print acceleration will be reduced during the affected moves to keep within the limit.
725
+ *
726
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
727
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
719
  */
728
  */
720
 //#define LIN_ADVANCE
729
 //#define LIN_ADVANCE
721
-
722
 #if ENABLED(LIN_ADVANCE)
730
 #if ENABLED(LIN_ADVANCE)
723
-  #define LIN_ADVANCE_K 75
724
-
725
-  /**
726
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
727
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
728
-   * While this is harmless for normal printing (the fluid nature of the filament will
729
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
730
-   *
731
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
732
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
733
-   * if the slicer is using variable widths or layer heights within one print!
734
-   *
735
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
736
-   *
737
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
738
-   *   - W is the extrusion width in mm
739
-   *   - H is the layer height in mm
740
-   *   - D is the filament diameter in mm
741
-   *
742
-   * Example: `M900 R0.0458` to set the ratio directly.
743
-   *
744
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
745
-   *
746
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
747
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
748
-   */
749
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
750
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
731
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
732
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
751
 #endif
733
 #endif
752
 
734
 
753
 // @section leveling
735
 // @section leveling

+ 14
- 32
Marlin/src/config/examples/wt150/Configuration_adv.h 查看文件

712
 // @section extruder
712
 // @section extruder
713
 
713
 
714
 /**
714
 /**
715
- * Implementation of linear pressure control
715
+ * Linear Pressure Control v1.5
716
  *
716
  *
717
- * Assumption: advance = k * (delta velocity)
717
+ * Assumption: advance [steps] = k * (delta velocity [steps/s])
718
  * K=0 means advance disabled.
718
  * K=0 means advance disabled.
719
- * See Marlin documentation for calibration instructions.
719
+ *
720
+ * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions!
721
+ *
722
+ * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak.
723
+ * Larger K values will be needed for flexible filament and greater distances.
724
+ * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
725
+ * print acceleration will be reduced during the affected moves to keep within the limit.
726
+ *
727
+ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
728
+ * Mention @Sebastianv650 on GitHub to alert the author of any issues.
720
  */
729
  */
721
 //#define LIN_ADVANCE
730
 //#define LIN_ADVANCE
722
-
723
 #if ENABLED(LIN_ADVANCE)
731
 #if ENABLED(LIN_ADVANCE)
724
-  #define LIN_ADVANCE_K 75
725
-
726
-  /**
727
-   * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
728
-   * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
729
-   * While this is harmless for normal printing (the fluid nature of the filament will
730
-   * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
731
-   *
732
-   * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
733
-   * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
734
-   * if the slicer is using variable widths or layer heights within one print!
735
-   *
736
-   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
737
-   *
738
-   * Example: `M900 W0.4 H0.2 D1.75`, where:
739
-   *   - W is the extrusion width in mm
740
-   *   - H is the layer height in mm
741
-   *   - D is the filament diameter in mm
742
-   *
743
-   * Example: `M900 R0.0458` to set the ratio directly.
744
-   *
745
-   * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
746
-   *
747
-   * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
748
-   * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
749
-   */
750
-  #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
751
-                                  // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
732
+  #define LIN_ADVANCE_K 0.22  // Unit: mm compression per 1mm/s extruder speed
733
+  //#define LA_DEBUG          // If enabled, this will generate debug information output over USB.
752
 #endif
734
 #endif
753
 
735
 
754
 // @section leveling
736
 // @section leveling

+ 7
- 22
Marlin/src/gcode/feature/advance/M900.cpp 查看文件

29
 #include "../../../module/stepper.h"
29
 #include "../../../module/stepper.h"
30
 
30
 
31
 /**
31
 /**
32
- * M900: Set and/or Get advance K factor and WH/D ratio
32
+ * M900: Set and/or Get advance K factor
33
  *
33
  *
34
  *  K<factor>                  Set advance K factor
34
  *  K<factor>                  Set advance K factor
35
- *  R<ratio>                   Set ratio directly (overrides WH/D)
36
- *  W<width> H<height> D<diam> Set ratio from WH/D
37
  */
35
  */
38
 void GcodeSuite::M900() {
36
 void GcodeSuite::M900() {
39
-  stepper.synchronize();
37
+    stepper.synchronize();
40
 
38
 
41
-  const float newK = parser.floatval('K', -1);
42
-  if (newK >= 0) planner.extruder_advance_k = newK;
39
+    const float newK = parser.floatval('K', -1);
40
+    if (newK >= 0) planner.extruder_advance_K = newK;
43
 
41
 
44
-  float newR = parser.floatval('R', -1);
45
-  if (newR < 0) {
46
-    const float newD = parser.floatval('D', -1),
47
-                newW = parser.floatval('W', -1),
48
-                newH = parser.floatval('H', -1);
49
-    if (newD >= 0 && newW >= 0 && newH >= 0)
50
-      newR = newD ? (newW * newH) / CIRCLE_AREA(newD * 0.5) : 0;
51
-  }
52
-  if (newR >= 0) planner.advance_ed_ratio = newR;
53
-
54
-  SERIAL_ECHO_START();
55
-  SERIAL_ECHOPAIR("Advance K=", planner.extruder_advance_k);
56
-  SERIAL_ECHOPGM(" E/D=");
57
-  const float ratio = planner.advance_ed_ratio;
58
-  if (ratio) SERIAL_ECHO(ratio); else SERIAL_ECHOPGM("Auto");
59
-  SERIAL_EOL();
42
+    SERIAL_ECHO_START();
43
+    SERIAL_ECHOPAIR("Advance K=", planner.extruder_advance_K);
44
+    SERIAL_EOL();
60
 }
45
 }
61
 
46
 
62
 #endif // LIN_ADVANCE
47
 #endif // LIN_ADVANCE

+ 0
- 6
Marlin/src/inc/Conditionals_LCD.h 查看文件

399
  *  HOTENDS      - Number of hotends, whether connected or separate
399
  *  HOTENDS      - Number of hotends, whether connected or separate
400
  *  E_STEPPERS   - Number of actual E stepper motors
400
  *  E_STEPPERS   - Number of actual E stepper motors
401
  *  E_MANUAL     - Number of E steppers for LCD move options
401
  *  E_MANUAL     - Number of E steppers for LCD move options
402
- *  TOOL_E_INDEX - Index to use when getting/setting the tool state
403
  *
402
  *
404
  */
403
  */
405
 #if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER)         // One hotend, one thermistor, no XY offset
404
 #if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER)         // One hotend, one thermistor, no XY offset
426
   #if EXTRUDERS > 4
425
   #if EXTRUDERS > 4
427
     #define E_STEPPERS    3
426
     #define E_STEPPERS    3
428
     #define E_MANUAL      3
427
     #define E_MANUAL      3
429
-    #define TOOL_E_INDEX  current_block->active_extruder
430
   #elif EXTRUDERS > 2
428
   #elif EXTRUDERS > 2
431
     #define E_STEPPERS    2
429
     #define E_STEPPERS    2
432
     #define E_MANUAL      2
430
     #define E_MANUAL      2
433
-    #define TOOL_E_INDEX  current_block->active_extruder
434
   #else
431
   #else
435
     #define E_STEPPERS    1
432
     #define E_STEPPERS    1
436
-    #define TOOL_E_INDEX  0
437
   #endif
433
   #endif
438
   #define E_MANUAL        E_STEPPERS
434
   #define E_MANUAL        E_STEPPERS
439
 #elif ENABLED(MIXING_EXTRUDER)
435
 #elif ENABLED(MIXING_EXTRUDER)
440
   #define E_STEPPERS      MIXING_STEPPERS
436
   #define E_STEPPERS      MIXING_STEPPERS
441
   #define E_MANUAL        1
437
   #define E_MANUAL        1
442
-  #define TOOL_E_INDEX    0
443
 #else
438
 #else
444
   #define E_STEPPERS      EXTRUDERS
439
   #define E_STEPPERS      EXTRUDERS
445
   #define E_MANUAL        EXTRUDERS
440
   #define E_MANUAL        EXTRUDERS
446
-  #define TOOL_E_INDEX    current_block->active_extruder
447
 #endif
441
 #endif
448
 
442
 
449
 /**
443
 /**

+ 2
- 4
Marlin/src/inc/SanityCheck.h 查看文件

223
   #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
223
   #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
224
 #elif defined(ADVANCE)
224
 #elif defined(ADVANCE)
225
   #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
225
   #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
226
+#elif defined(LIN_ADVANCE_E_D_RATIO)
227
+  #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration."
226
 #elif defined(NEOPIXEL_RGBW_LED)
228
 #elif defined(NEOPIXEL_RGBW_LED)
227
   #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
229
   #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
228
 #elif defined(UBL_MESH_INSET)
230
 #elif defined(UBL_MESH_INSET)
552
   #endif
554
   #endif
553
 #endif
555
 #endif
554
 
556
 
555
-#if ENABLED(LIN_ADVANCE) && !IS_CARTESIAN
556
-  #error "Sorry! LIN_ADVANCE is only compatible with Cartesian."
557
-#endif
558
-
559
 /**
557
 /**
560
  * Parking Extruder requirements
558
  * Parking Extruder requirements
561
  */
559
  */

+ 2
- 2
Marlin/src/lcd/ultralcd.cpp 查看文件

3228
     #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
3228
     #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
3229
       MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
3229
       MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
3230
     #elif ENABLED(LIN_ADVANCE)
3230
     #elif ENABLED(LIN_ADVANCE)
3231
-      MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999);
3231
+      MENU_ITEM_EDIT(float32, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3232
     #endif
3232
     #endif
3233
 
3233
 
3234
     #if HAS_LCD_CONTRAST
3234
     #if HAS_LCD_CONTRAST
3742
       MENU_BACK(MSG_CONTROL);
3742
       MENU_BACK(MSG_CONTROL);
3743
 
3743
 
3744
       #if ENABLED(LIN_ADVANCE)
3744
       #if ENABLED(LIN_ADVANCE)
3745
-        MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999);
3745
+        MENU_ITEM_EDIT(float32, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3746
       #endif
3746
       #endif
3747
 
3747
 
3748
       #if DISABLED(NO_VOLUMETRICS)
3748
       #if DISABLED(NO_VOLUMETRICS)

+ 8
- 15
Marlin/src/module/configuration_store.cpp 查看文件

37
  */
37
  */
38
 
38
 
39
 // Change EEPROM version if the structure changes
39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V51"
40
+#define EEPROM_VERSION "V52"
41
 #define EEPROM_OFFSET 100
41
 #define EEPROM_OFFSET 100
42
 
42
 
43
 // Check the integrity of data offsets.
43
 // Check the integrity of data offsets.
225
   //
225
   //
226
   // LIN_ADVANCE
226
   // LIN_ADVANCE
227
   //
227
   //
228
-  float planner_extruder_advance_k,                     // M900 K    planner.extruder_advance_k
229
-        planner_advance_ed_ratio;                       // M900 WHD  planner.advance_ed_ratio
228
+  float planner_extruder_advance_K;                     // M900 K    planner.extruder_advance_K
230
 
229
 
231
   //
230
   //
232
   // HAS_MOTOR_CURRENT_PWM
231
   // HAS_MOTOR_CURRENT_PWM
751
     // Linear Advance
750
     // Linear Advance
752
     //
751
     //
753
 
752
 
754
-    _FIELD_TEST(planner_extruder_advance_k);
753
+    _FIELD_TEST(planner_extruder_advance_K);
755
 
754
 
756
     #if ENABLED(LIN_ADVANCE)
755
     #if ENABLED(LIN_ADVANCE)
757
-      EEPROM_WRITE(planner.extruder_advance_k);
758
-      EEPROM_WRITE(planner.advance_ed_ratio);
756
+      EEPROM_WRITE(planner.extruder_advance_K);
759
     #else
757
     #else
760
       dummy = 0.0f;
758
       dummy = 0.0f;
761
       EEPROM_WRITE(dummy);
759
       EEPROM_WRITE(dummy);
762
-      EEPROM_WRITE(dummy);
763
     #endif
760
     #endif
764
 
761
 
765
     _FIELD_TEST(motor_current_setting);
762
     _FIELD_TEST(motor_current_setting);
1301
       // Linear Advance
1298
       // Linear Advance
1302
       //
1299
       //
1303
 
1300
 
1304
-      _FIELD_TEST(planner_extruder_advance_k);
1301
+      _FIELD_TEST(planner_extruder_advance_K);
1305
 
1302
 
1306
       #if ENABLED(LIN_ADVANCE)
1303
       #if ENABLED(LIN_ADVANCE)
1307
-        EEPROM_READ(planner.extruder_advance_k);
1308
-        EEPROM_READ(planner.advance_ed_ratio);
1304
+        EEPROM_READ(planner.extruder_advance_K);
1309
       #else
1305
       #else
1310
         EEPROM_READ(dummy);
1306
         EEPROM_READ(dummy);
1311
-        EEPROM_READ(dummy);
1312
       #endif
1307
       #endif
1313
 
1308
 
1314
       //
1309
       //
1832
   #endif
1827
   #endif
1833
 
1828
 
1834
   #if ENABLED(LIN_ADVANCE)
1829
   #if ENABLED(LIN_ADVANCE)
1835
-    planner.extruder_advance_k = LIN_ADVANCE_K;
1836
-    planner.advance_ed_ratio = LIN_ADVANCE_E_D_RATIO;
1830
+    planner.extruder_advance_K = LIN_ADVANCE_K;
1837
   #endif
1831
   #endif
1838
 
1832
 
1839
   #if HAS_MOTOR_CURRENT_PWM
1833
   #if HAS_MOTOR_CURRENT_PWM
2409
         SERIAL_ECHOLNPGM_P(port, "Linear Advance:");
2403
         SERIAL_ECHOLNPGM_P(port, "Linear Advance:");
2410
       }
2404
       }
2411
       CONFIG_ECHO_START;
2405
       CONFIG_ECHO_START;
2412
-      SERIAL_ECHOPAIR_P(port, "  M900 K", planner.extruder_advance_k);
2413
-      SERIAL_ECHOLNPAIR_P(port, " R", planner.advance_ed_ratio);
2406
+      SERIAL_ECHOLNPAIR_P(port, "  M900 K", planner.extruder_advance_K);
2414
     #endif
2407
     #endif
2415
 
2408
 
2416
     #if HAS_MOTOR_CURRENT_PWM
2409
     #if HAS_MOTOR_CURRENT_PWM

+ 126
- 102
Marlin/src/module/planner.cpp 查看文件

185
 #endif
185
 #endif
186
 
186
 
187
 #if ENABLED(LIN_ADVANCE)
187
 #if ENABLED(LIN_ADVANCE)
188
-  float Planner::extruder_advance_k, // Initialized by settings.load()
189
-        Planner::advance_ed_ratio,   // Initialized by settings.load()
190
-        Planner::position_float[XYZE], // Needed for accurate maths. Steps cannot be used!
191
-        Planner::lin_dist_xy,
192
-        Planner::lin_dist_e;
188
+  float Planner::extruder_advance_K, // Initialized by settings.load()
189
+        Planner::position_float[XYZE]; // Needed for accurate maths. Steps cannot be used!
193
 #endif
190
 #endif
194
 
191
 
195
 #if ENABLED(ULTRA_LCD)
192
 #if ENABLED(ULTRA_LCD)
364
         // NOTE: Entry and exit factors always > 0 by all previous logic operations.
361
         // NOTE: Entry and exit factors always > 0 by all previous logic operations.
365
         const float nomr = 1.0 / current->nominal_speed;
362
         const float nomr = 1.0 / current->nominal_speed;
366
         calculate_trapezoid_for_block(current, current->entry_speed * nomr, next->entry_speed * nomr);
363
         calculate_trapezoid_for_block(current, current->entry_speed * nomr, next->entry_speed * nomr);
364
+        #if ENABLED(LIN_ADVANCE)
365
+          if (current->use_advance_lead) {
366
+            const float comp = current->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS];
367
+            current->max_adv_steps = current->nominal_speed * comp;
368
+            current->final_adv_steps = next->entry_speed * comp;
369
+          }
370
+        #endif
367
         CBI(current->flag, BLOCK_BIT_RECALCULATE); // Reset current only to ensure next trapezoid is computed
371
         CBI(current->flag, BLOCK_BIT_RECALCULATE); // Reset current only to ensure next trapezoid is computed
368
       }
372
       }
369
     }
373
     }
373
   if (next) {
377
   if (next) {
374
     const float nomr = 1.0 / next->nominal_speed;
378
     const float nomr = 1.0 / next->nominal_speed;
375
     calculate_trapezoid_for_block(next, next->entry_speed * nomr, (MINIMUM_PLANNER_SPEED) * nomr);
379
     calculate_trapezoid_for_block(next, next->entry_speed * nomr, (MINIMUM_PLANNER_SPEED) * nomr);
380
+    #if ENABLED(LIN_ADVANCE)
381
+      if (next->use_advance_lead) {
382
+        const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS];
383
+        next->max_adv_steps = next->nominal_speed * comp;
384
+        next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp;
385
+      }
386
+    #endif
376
     CBI(next->flag, BLOCK_BIT_RECALCULATE);
387
     CBI(next->flag, BLOCK_BIT_RECALCULATE);
377
   }
388
   }
378
 }
389
 }
730
  *  fr_mm_s     - (target) speed of the move
741
  *  fr_mm_s     - (target) speed of the move
731
  *  extruder    - target extruder
742
  *  extruder    - target extruder
732
  */
743
  */
733
-void Planner::_buffer_steps(const int32_t (&target)[ABCE], float fr_mm_s, const uint8_t extruder, const float &millimeters /*= 0.0*/) {
744
+void Planner::_buffer_steps(const int32_t (&target)[XYZE]
745
+  #if ENABLED(LIN_ADVANCE)
746
+    , const float (&target_float)[XYZE]
747
+  #endif
748
+  , float fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
749
+) {
734
 
750
 
735
   const int32_t da = target[A_AXIS] - position[A_AXIS],
751
   const int32_t da = target[A_AXIS] - position[A_AXIS],
736
                 db = target[B_AXIS] - position[B_AXIS],
752
                 db = target[B_AXIS] - position[B_AXIS],
751
     SERIAL_ECHOLNPGM(" steps)");
767
     SERIAL_ECHOLNPGM(" steps)");
752
   //*/
768
   //*/
753
 
769
 
754
-  // If LIN_ADVANCE is disabled then do E move prevention with integers
755
-  // Otherwise it's done in _buffer_segment.
756
-  #if DISABLED(LIN_ADVANCE) && (ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE))
770
+  #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
757
     if (de) {
771
     if (de) {
758
       #if ENABLED(PREVENT_COLD_EXTRUSION)
772
       #if ENABLED(PREVENT_COLD_EXTRUSION)
759
         if (thermalManager.tooColdToExtrude(extruder)) {
773
         if (thermalManager.tooColdToExtrude(extruder)) {
760
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
774
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
775
+          #if ENABLED(LIN_ADVANCE)
776
+            position_float[E_AXIS] = target_float[E_AXIS];
777
+          #endif
761
           de = 0; // no difference
778
           de = 0; // no difference
762
           SERIAL_ECHO_START();
779
           SERIAL_ECHO_START();
763
           SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
780
           SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
766
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
783
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
767
         if (labs(de * e_factor[extruder]) > (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
784
         if (labs(de * e_factor[extruder]) > (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
768
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
785
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
786
+          #if ENABLED(LIN_ADVANCE)
787
+            position_float[E_AXIS] = target_float[E_AXIS];
788
+          #endif
769
           de = 0; // no difference
789
           de = 0; // no difference
770
           SERIAL_ECHO_START();
790
           SERIAL_ECHO_START();
771
           SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
791
           SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
772
         }
792
         }
773
       #endif // PREVENT_LENGTHY_EXTRUDE
793
       #endif // PREVENT_LENGTHY_EXTRUDE
774
     }
794
     }
775
-  #endif // !LIN_ADVANCE && (PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE)
795
+  #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
776
 
796
 
777
   // Compute direction bit-mask for this block
797
   // Compute direction bit-mask for this block
778
   uint8_t dm = 0;
798
   uint8_t dm = 0;
1189
   if (!block->steps[A_AXIS] && !block->steps[B_AXIS] && !block->steps[C_AXIS]) {
1209
   if (!block->steps[A_AXIS] && !block->steps[B_AXIS] && !block->steps[C_AXIS]) {
1190
     // convert to: acceleration steps/sec^2
1210
     // convert to: acceleration steps/sec^2
1191
     accel = CEIL(retract_acceleration * steps_per_mm);
1211
     accel = CEIL(retract_acceleration * steps_per_mm);
1212
+    #if ENABLED(LIN_ADVANCE)
1213
+      block->use_advance_lead = false;
1214
+    #endif
1192
   }
1215
   }
1193
   else {
1216
   else {
1194
     #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \
1217
     #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \
1208
     // Start with print or travel acceleration
1231
     // Start with print or travel acceleration
1209
     accel = CEIL((esteps ? acceleration : travel_acceleration) * steps_per_mm);
1232
     accel = CEIL((esteps ? acceleration : travel_acceleration) * steps_per_mm);
1210
 
1233
 
1234
+    #if ENABLED(LIN_ADVANCE)
1235
+      /**
1236
+       *
1237
+       * Use LIN_ADVANCE for blocks if all these are true:
1238
+       *
1239
+       * esteps             : This is a print move, because we checked for A, B, C steps before.
1240
+       *
1241
+       * extruder_advance_K : There is an advance factor set.
1242
+       *
1243
+       * de > 0             : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves)
1244
+       */
1245
+      block->use_advance_lead =  esteps
1246
+                              && extruder_advance_K
1247
+                              && de > 0;
1248
+
1249
+      if (block->use_advance_lead) {
1250
+        block->e_D_ratio = (target_float[E_AXIS] - position_float[E_AXIS]) /
1251
+          #if IS_KINEMATIC
1252
+            block->millimeters
1253
+          #else
1254
+            SQRT(sq(target_float[X_AXIS] - position_float[X_AXIS])
1255
+               + sq(target_float[Y_AXIS] - position_float[Y_AXIS])
1256
+               + sq(target_float[Z_AXIS] - position_float[Z_AXIS]))
1257
+          #endif
1258
+        ;
1259
+
1260
+        // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance!
1261
+        // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament.
1262
+        if (block->e_D_ratio > 3.0)
1263
+          block->use_advance_lead = false;
1264
+        else {
1265
+          const uint32_t max_accel_steps_per_s2 = max_jerk[E_AXIS] / (extruder_advance_K * block->e_D_ratio) * steps_per_mm;
1266
+          #if ENABLED(LA_DEBUG)
1267
+            if (accel > max_accel_steps_per_s2)
1268
+              SERIAL_ECHOLNPGM("Acceleration limited.");
1269
+          #endif
1270
+          NOMORE(accel, max_accel_steps_per_s2);
1271
+        }
1272
+      }
1273
+    #endif
1274
+
1211
     #if ENABLED(DISTINCT_E_FACTORS)
1275
     #if ENABLED(DISTINCT_E_FACTORS)
1212
       #define ACCEL_IDX extruder
1276
       #define ACCEL_IDX extruder
1213
     #else
1277
     #else
1230
   }
1294
   }
1231
   block->acceleration_steps_per_s2 = accel;
1295
   block->acceleration_steps_per_s2 = accel;
1232
   block->acceleration = accel / steps_per_mm;
1296
   block->acceleration = accel / steps_per_mm;
1233
-  block->acceleration_rate = (long)(accel * 16777216.0 / (HAL_STEPPER_TIMER_RATE)); // 16777216 = <<24
1297
+  block->acceleration_rate = (long)(accel * 16777216.0 / ((F_CPU) * 0.125)); // * 8.388608
1298
+  #if ENABLED(LIN_ADVANCE)
1299
+    if (block->use_advance_lead) {
1300
+      block->advance_speed = ((F_CPU) * 0.125) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]);
1301
+      #if ENABLED(LA_DEBUG)
1302
+        if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < block->nominal_speed * block->e_D_ratio)
1303
+          SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed.");
1304
+        if (block->advance_speed < 200)
1305
+          SERIAL_ECHOLNPGM("eISR running at > 10kHz.");
1306
+      #endif
1307
+    }
1308
+  #endif
1234
 
1309
 
1235
   // Initial limit on the segment entry velocity
1310
   // Initial limit on the segment entry velocity
1236
   float vmax_junction;
1311
   float vmax_junction;
1386
   previous_nominal_speed = block->nominal_speed;
1461
   previous_nominal_speed = block->nominal_speed;
1387
   previous_safe_speed = safe_speed;
1462
   previous_safe_speed = safe_speed;
1388
 
1463
 
1389
-  #if ENABLED(LIN_ADVANCE)
1390
-    /**
1391
-     *
1392
-     * Use LIN_ADVANCE for blocks if all these are true:
1393
-     *
1394
-     * esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS]) : This is a print move
1395
-     *
1396
-     * extruder_advance_k                 : There is an advance factor set.
1397
-     *
1398
-     * esteps != block->step_event_count  : A problem occurs if the move before a retract is too small.
1399
-     *                                      In that case, the retract and move will be executed together.
1400
-     *                                      This leads to too many advance steps due to a huge e_acceleration.
1401
-     *                                      The math is good, but we must avoid retract moves with advance!
1402
-     * lin_dist_e > 0                       : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves)
1403
-     */
1404
-    block->use_advance_lead =  esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS])
1405
-                            && extruder_advance_k
1406
-                            && (uint32_t)esteps != block->step_event_count
1407
-                            && lin_dist_e > 0;
1408
-    if (block->use_advance_lead)
1409
-      block->abs_adv_steps_multiplier8 = LROUND(
1410
-        extruder_advance_k
1411
-        * (UNEAR_ZERO(advance_ed_ratio) ? lin_dist_e / lin_dist_xy : advance_ed_ratio) // Use the fixed ratio, if set
1412
-        * (block->nominal_speed / (float)block->nominal_rate)
1413
-        * axis_steps_per_mm[E_AXIS_N] * 256.0
1414
-      );
1415
-
1416
-  #endif // LIN_ADVANCE
1417
-
1418
   // Move buffer head
1464
   // Move buffer head
1419
   block_buffer_head = next_buffer_head;
1465
   block_buffer_head = next_buffer_head;
1420
 
1466
 
1421
   // Update the position (only when a move was queued)
1467
   // Update the position (only when a move was queued)
1422
   static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!");
1468
   static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!");
1423
   COPY(position, target);
1469
   COPY(position, target);
1470
+  #if ENABLED(LIN_ADVANCE)
1471
+    COPY(position_float, target_float);
1472
+  #endif
1424
 
1473
 
1425
   recalculate();
1474
   recalculate();
1426
 
1475
 
1438
  *  extruder    - target extruder
1487
  *  extruder    - target extruder
1439
  *  millimeters - the length of the movement, if known
1488
  *  millimeters - the length of the movement, if known
1440
  */
1489
  */
1441
-void Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters /*= 0.0*/) {
1490
+void Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/) {
1442
   // When changing extruders recalculate steps corresponding to the E position
1491
   // When changing extruders recalculate steps corresponding to the E position
1443
   #if ENABLED(DISTINCT_E_FACTORS)
1492
   #if ENABLED(DISTINCT_E_FACTORS)
1444
     if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
1493
     if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
1456
     LROUND(e * axis_steps_per_mm[E_AXIS_N])
1505
     LROUND(e * axis_steps_per_mm[E_AXIS_N])
1457
   };
1506
   };
1458
 
1507
 
1508
+  #if ENABLED(LIN_ADVANCE)
1509
+    const float target_float[XYZE] = { a, b, c, e };
1510
+  #endif
1511
+
1512
+  // DRYRUN prevents E moves from taking place
1513
+  if (DEBUGGING(DRYRUN)) {
1514
+    position[E_AXIS] = target[E_AXIS];
1515
+    #if ENABLED(LIN_ADVANCE)
1516
+      position_float[E_AXIS] = e;
1517
+    #endif
1518
+  }
1519
+
1459
   /* <-- add a slash to enable
1520
   /* <-- add a slash to enable
1460
     SERIAL_ECHOPAIR("  buffer_segment FR:", fr_mm_s);
1521
     SERIAL_ECHOPAIR("  buffer_segment FR:", fr_mm_s);
1461
     #if IS_KINEMATIC
1522
     #if IS_KINEMATIC
1484
     SERIAL_ECHOLNPGM(")");
1545
     SERIAL_ECHOLNPGM(")");
1485
   //*/
1546
   //*/
1486
 
1547
 
1487
-  // DRYRUN prevents E moves from taking place
1488
-  if (DEBUGGING(DRYRUN)) {
1489
-    position[E_AXIS] = target[E_AXIS];
1490
-    #if ENABLED(LIN_ADVANCE)
1491
-      position_float[E_AXIS] = e;
1492
-    #endif
1493
-  }
1494
-
1495
-  #if ENABLED(LIN_ADVANCE)
1496
-    lin_dist_e = e - position_float[E_AXIS];
1497
-  #endif
1498
-
1499
-  // If LIN_ADVANCE is enabled then do E move prevention with floats
1500
-  // Otherwise it's done in _buffer_steps.
1501
-  #if ENABLED(LIN_ADVANCE) && (ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE))
1502
-    if (lin_dist_e) {
1503
-      #if ENABLED(PREVENT_COLD_EXTRUSION)
1504
-        if (thermalManager.tooColdToExtrude(extruder)) {
1505
-          position_float[E_AXIS] = e; // Behave as if the move really took place, but ignore E part
1506
-          position[E_AXIS] = target[E_AXIS];
1507
-          lin_dist_e = 0;
1508
-          SERIAL_ECHO_START();
1509
-          SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
1510
-        }
1511
-      #endif // PREVENT_COLD_EXTRUSION
1512
-      #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
1513
-        if (lin_dist_e * e_factor[extruder] > (EXTRUDE_MAXLENGTH)) {
1514
-          position_float[E_AXIS] = e; // Behave as if the move really took place, but ignore E part
1515
-          position[E_AXIS] = target[E_AXIS];
1516
-          lin_dist_e = 0;
1517
-          SERIAL_ECHO_START();
1518
-          SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
1519
-        }
1520
-      #endif // PREVENT_LENGTHY_EXTRUDE
1521
-    }
1522
-  #endif // LIN_ADVANCE && (PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE)
1523
-
1524
-  #if ENABLED(LIN_ADVANCE)
1525
-    if (lin_dist_e > 0)
1526
-      lin_dist_xy = HYPOT(a - position_float[X_AXIS], b - position_float[Y_AXIS]);
1527
-  #endif
1528
-
1529
   // Always split the first move into two (if not homing or probing)
1548
   // Always split the first move into two (if not homing or probing)
1530
   if (!blocks_queued()) {
1549
   if (!blocks_queued()) {
1531
 
1550
 
1532
     #define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1
1551
     #define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1
1533
     const int32_t between[ABCE] = { _BETWEEN(A), _BETWEEN(B), _BETWEEN(C), _BETWEEN(E) };
1552
     const int32_t between[ABCE] = { _BETWEEN(A), _BETWEEN(B), _BETWEEN(C), _BETWEEN(E) };
1534
-    DISABLE_STEPPER_DRIVER_INTERRUPT();
1535
 
1553
 
1536
     #if ENABLED(LIN_ADVANCE)
1554
     #if ENABLED(LIN_ADVANCE)
1537
-      lin_dist_xy *= 0.5;
1538
-      lin_dist_e *= 0.5;
1555
+      #define _BETWEEN_F(A) (position_float[A##_AXIS] + target_float[A##_AXIS]) * 0.5
1556
+      const float between_float[ABCE] = { _BETWEEN_F(A), _BETWEEN_F(B), _BETWEEN_F(C), _BETWEEN_F(E) };
1539
     #endif
1557
     #endif
1540
 
1558
 
1541
-    _buffer_steps(between, fr_mm_s, extruder, millimeters * 0.5);
1559
+    DISABLE_STEPPER_DRIVER_INTERRUPT();
1542
 
1560
 
1543
-    #if ENABLED(LIN_ADVANCE)
1544
-      position_float[X_AXIS] = (position_float[X_AXIS] + a) * 0.5;
1545
-      position_float[Y_AXIS] = (position_float[Y_AXIS] + b) * 0.5;
1546
-      //position_float[Z_AXIS] = (position_float[Z_AXIS] + c) * 0.5;
1547
-      position_float[E_AXIS] = (position_float[E_AXIS] + e) * 0.5;
1548
-    #endif
1561
+    _buffer_steps(between
1562
+      #if ENABLED(LIN_ADVANCE)
1563
+        , between_float
1564
+      #endif
1565
+      , fr_mm_s, extruder, millimeters * 0.5
1566
+    );
1549
 
1567
 
1550
     const uint8_t next = block_buffer_head;
1568
     const uint8_t next = block_buffer_head;
1551
-    _buffer_steps(target, fr_mm_s, extruder, millimeters * 0.5);
1569
+
1570
+    _buffer_steps(target
1571
+      #if ENABLED(LIN_ADVANCE)
1572
+        , target_float
1573
+      #endif
1574
+      , fr_mm_s, extruder, millimeters * 0.5
1575
+    );
1576
+
1552
     SBI(block_buffer[next].flag, BLOCK_BIT_CONTINUED);
1577
     SBI(block_buffer[next].flag, BLOCK_BIT_CONTINUED);
1553
     ENABLE_STEPPER_DRIVER_INTERRUPT();
1578
     ENABLE_STEPPER_DRIVER_INTERRUPT();
1554
   }
1579
   }
1555
   else
1580
   else
1556
-    _buffer_steps(target, fr_mm_s, extruder, millimeters);
1581
+    _buffer_steps(target
1582
+      #if ENABLED(LIN_ADVANCE)
1583
+        , target_float
1584
+      #endif
1585
+      , fr_mm_s, extruder, millimeters
1586
+    );
1557
 
1587
 
1558
   stepper.wake_up();
1588
   stepper.wake_up();
1559
 
1589
 
1560
-  #if ENABLED(LIN_ADVANCE)
1561
-    position_float[X_AXIS] = a;
1562
-    position_float[Y_AXIS] = b;
1563
-    //position_float[Z_AXIS] = c;
1564
-    position_float[E_AXIS] = e;
1565
-  #endif
1566
 } // buffer_segment()
1590
 } // buffer_segment()
1567
 
1591
 
1568
 /**
1592
 /**
1586
   #if ENABLED(LIN_ADVANCE)
1610
   #if ENABLED(LIN_ADVANCE)
1587
     position_float[X_AXIS] = a;
1611
     position_float[X_AXIS] = a;
1588
     position_float[Y_AXIS] = b;
1612
     position_float[Y_AXIS] = b;
1589
-    //position_float[Z_AXIS] = c;
1613
+    position_float[Z_AXIS] = c;
1590
     position_float[E_AXIS] = e;
1614
     position_float[E_AXIS] = e;
1591
   #endif
1615
   #endif
1592
   stepper.set_position(na, nb, nc, ne);
1616
   stepper.set_position(na, nb, nc, ne);

+ 13
- 6
Marlin/src/module/planner.h 查看文件

103
   // Advance extrusion
103
   // Advance extrusion
104
   #if ENABLED(LIN_ADVANCE)
104
   #if ENABLED(LIN_ADVANCE)
105
     bool use_advance_lead;
105
     bool use_advance_lead;
106
-    uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float
106
+    uint16_t advance_speed,                 // Timer value for extruder speed offset
107
+             max_adv_steps,                 // max. advance steps to get cruising speed pressure (not always nominal_speed!)
108
+             final_adv_steps;               // advance steps due to exit speed
109
+    float e_D_ratio;
107
   #endif
110
   #endif
108
 
111
 
109
   // Fields used by the motion planner to manage acceleration
112
   // Fields used by the motion planner to manage acceleration
195
     #endif
198
     #endif
196
 
199
 
197
     #if ENABLED(LIN_ADVANCE)
200
     #if ENABLED(LIN_ADVANCE)
198
-      static float extruder_advance_k, advance_ed_ratio,
199
-                   position_float[XYZE],
200
-                   lin_dist_xy, lin_dist_e;
201
+      static float extruder_advance_K,
202
+                   position_float[XYZE];
201
     #endif
203
     #endif
202
 
204
 
203
     #if ENABLED(SKEW_CORRECTION)
205
     #if ENABLED(SKEW_CORRECTION)
418
      *  extruder    - target extruder
420
      *  extruder    - target extruder
419
      *  millimeters - the length of the movement, if known
421
      *  millimeters - the length of the movement, if known
420
      */
422
      */
421
-    static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder, const float &millimeters = 0.0);
423
+    static void _buffer_steps(const int32_t (&target)[XYZE]
424
+      #if ENABLED(LIN_ADVANCE)
425
+        , const float (&target_float)[XYZE]
426
+      #endif
427
+      , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
428
+    );
422
 
429
 
423
     /**
430
     /**
424
      * Planner::buffer_segment
431
      * Planner::buffer_segment
432
      *  extruder    - target extruder
439
      *  extruder    - target extruder
433
      *  millimeters - the length of the movement, if known
440
      *  millimeters - the length of the movement, if known
434
      */
441
      */
435
-    static void buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters = 0.0);
442
+    static void buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0);
436
 
443
 
437
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
444
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
438
 
445
 

+ 99
- 107
Marlin/src/module/stepper.cpp 查看文件

111
 
111
 
112
 #if ENABLED(LIN_ADVANCE)
112
 #if ENABLED(LIN_ADVANCE)
113
 
113
 
114
+  uint32_t Stepper::LA_decelerate_after;
115
+
114
   constexpr hal_timer_t ADV_NEVER = HAL_TIMER_TYPE_MAX;
116
   constexpr hal_timer_t ADV_NEVER = HAL_TIMER_TYPE_MAX;
115
 
117
 
116
   hal_timer_t Stepper::nextMainISR = 0,
118
   hal_timer_t Stepper::nextMainISR = 0,
117
               Stepper::nextAdvanceISR = ADV_NEVER,
119
               Stepper::nextAdvanceISR = ADV_NEVER,
118
               Stepper::eISR_Rate = ADV_NEVER;
120
               Stepper::eISR_Rate = ADV_NEVER;
121
+  uint16_t Stepper::current_adv_steps = 0,
122
+           Stepper::final_adv_steps,
123
+           Stepper::max_adv_steps;
119
 
124
 
120
-  volatile int Stepper::e_steps[E_STEPPERS];
121
-  int Stepper::final_estep_rate,
122
-      Stepper::current_estep_rate[E_STEPPERS],
123
-      Stepper::current_adv_steps[E_STEPPERS];
125
+  int8_t Stepper::e_steps = 0,
126
+         Stepper::LA_active_extruder; // Copy from current executed block. Needed because current_block is set to NULL "too early".
124
 
127
 
125
-  /**
126
-   * See https://github.com/MarlinFirmware/Marlin/issues/5699#issuecomment-309264382
127
-   *
128
-   * This fix isn't perfect and may lose steps - but better than locking up completely
129
-   * in future the planner should slow down if advance stepping rate would be too high
130
-   */
131
-  FORCE_INLINE hal_timer_t adv_rate(const int steps, const hal_timer_t timer, const uint8_t loops) {
132
-    if (steps) {
133
-      const hal_timer_t rate = (timer * loops) / abs(steps);
134
-      //return constrain(rate, 1, ADV_NEVER - 1)
135
-      return rate ? rate : 1;
136
-    }
137
-    return ADV_NEVER;
138
-  }
128
+  bool Stepper::use_advance_lead;
139
 
129
 
140
 #endif // LIN_ADVANCE
130
 #endif // LIN_ADVANCE
141
 
131
 
461
         #if DISABLED(MIXING_EXTRUDER)
451
         #if DISABLED(MIXING_EXTRUDER)
462
           // Don't step E here for mixing extruder
452
           // Don't step E here for mixing extruder
463
           count_position[E_AXIS] += count_direction[E_AXIS];
453
           count_position[E_AXIS] += count_direction[E_AXIS];
464
-          motor_direction(E_AXIS) ? --e_steps[TOOL_E_INDEX] : ++e_steps[TOOL_E_INDEX];
454
+          motor_direction(E_AXIS) ? --e_steps : ++e_steps;
465
         #endif
455
         #endif
466
       }
456
       }
467
 
457
 
640
 
630
 
641
   } // steps_loop
631
   } // steps_loop
642
 
632
 
643
-  #if ENABLED(LIN_ADVANCE)
644
-
645
-    if (current_block->use_advance_lead) {
646
-      const int delta_adv_steps = current_estep_rate[TOOL_E_INDEX] - current_adv_steps[TOOL_E_INDEX];
647
-      current_adv_steps[TOOL_E_INDEX] += delta_adv_steps;
648
-      #if ENABLED(MIXING_EXTRUDER)
649
-        // Mixing extruders apply advance lead proportionally
650
-        MIXING_STEPPERS_LOOP(j)
651
-          e_steps[j] += delta_adv_steps * current_block->step_event_count / current_block->mix_event_count[j];
652
-      #else
653
-        // For most extruders, advance the single E stepper
654
-        e_steps[TOOL_E_INDEX] += delta_adv_steps;
655
-      #endif
656
-    }
657
-    // If we have esteps to execute, fire the next advance_isr "now"
658
-    if (e_steps[TOOL_E_INDEX]) nextAdvanceISR = 0;
659
-
660
-  #endif // LIN_ADVANCE
661
-
662
   // Calculate new timer value
633
   // Calculate new timer value
663
   if (step_events_completed <= (uint32_t)current_block->accelerate_until) {
634
   if (step_events_completed <= (uint32_t)current_block->accelerate_until) {
664
 
635
 
683
     #if ENABLED(LIN_ADVANCE)
654
     #if ENABLED(LIN_ADVANCE)
684
 
655
 
685
       if (current_block->use_advance_lead) {
656
       if (current_block->use_advance_lead) {
686
-        #if ENABLED(MIXING_EXTRUDER)
687
-          MIXING_STEPPERS_LOOP(j)
688
-            current_estep_rate[j] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 17;
689
-        #else
690
-          current_estep_rate[TOOL_E_INDEX] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
691
-        #endif
657
+        if (step_events_completed == step_loops || (e_steps && eISR_Rate != current_block->advance_speed)) {
658
+          nextAdvanceISR = 0; // Wake up eISR on first acceleration loop and fire ISR if final adv_rate is reached
659
+          eISR_Rate = current_block->advance_speed;
660
+        }
661
+      }
662
+      else {
663
+        eISR_Rate = ADV_NEVER;
664
+        if (e_steps) nextAdvanceISR = 0;
692
       }
665
       }
693
-      eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], interval, step_loops);
694
 
666
 
695
     #endif // LIN_ADVANCE
667
     #endif // LIN_ADVANCE
696
   }
668
   }
719
     #if ENABLED(LIN_ADVANCE)
691
     #if ENABLED(LIN_ADVANCE)
720
 
692
 
721
       if (current_block->use_advance_lead) {
693
       if (current_block->use_advance_lead) {
722
-        #if ENABLED(MIXING_EXTRUDER)
723
-          MIXING_STEPPERS_LOOP(j)
724
-            current_estep_rate[j] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 17;
725
-        #else
726
-          current_estep_rate[TOOL_E_INDEX] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
727
-        #endif
694
+        if (step_events_completed <= (uint32_t)current_block->decelerate_after + step_loops || (e_steps && eISR_Rate != current_block->advance_speed)) {
695
+          nextAdvanceISR = 0; // Wake up eISR on first deceleration loop
696
+          eISR_Rate = current_block->advance_speed;
697
+        }
698
+      }
699
+      else {
700
+        eISR_Rate = ADV_NEVER;
701
+        if (e_steps) nextAdvanceISR = 0;
728
       }
702
       }
729
-      eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], interval, step_loops);
730
 
703
 
731
     #endif // LIN_ADVANCE
704
     #endif // LIN_ADVANCE
732
   }
705
   }
734
 
707
 
735
     #if ENABLED(LIN_ADVANCE)
708
     #if ENABLED(LIN_ADVANCE)
736
 
709
 
737
-      if (current_block->use_advance_lead)
738
-        current_estep_rate[TOOL_E_INDEX] = final_estep_rate;
739
-
740
-      eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], OCR1A_nominal, step_loops_nominal);
710
+      // If we have esteps to execute, fire the next advance_isr "now"
711
+      if (e_steps && eISR_Rate != current_block->advance_speed) nextAdvanceISR = 0;
741
 
712
 
742
     #endif
713
     #endif
743
 
714
 
781
     #if ENABLED(MK2_MULTIPLEXER)
752
     #if ENABLED(MK2_MULTIPLEXER)
782
       // Even-numbered steppers are reversed
753
       // Even-numbered steppers are reversed
783
       #define SET_E_STEP_DIR(INDEX) \
754
       #define SET_E_STEP_DIR(INDEX) \
784
-        if (e_steps[INDEX]) E## INDEX ##_DIR_WRITE(e_steps[INDEX] < 0 ? !INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0) : INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0))
755
+        if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? !INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0) : INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0))
785
     #else
756
     #else
786
       #define SET_E_STEP_DIR(INDEX) \
757
       #define SET_E_STEP_DIR(INDEX) \
787
-        if (e_steps[INDEX]) E## INDEX ##_DIR_WRITE(e_steps[INDEX] < 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR)
758
+        if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR)
788
     #endif
759
     #endif
789
 
760
 
790
     #define START_E_PULSE(INDEX) \
761
     #define START_E_PULSE(INDEX) \
791
-      if (e_steps[INDEX]) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN)
762
+      if (e_steps) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN)
792
 
763
 
793
     #define STOP_E_PULSE(INDEX) \
764
     #define STOP_E_PULSE(INDEX) \
794
-      if (e_steps[INDEX]) { \
795
-        e_steps[INDEX] < 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \
765
+      if (e_steps) { \
766
+        e_steps < 0 ? ++e_steps : --e_steps; \
796
         E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
767
         E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
797
       }
768
       }
798
 
769
 
799
-    SET_E_STEP_DIR(0);
800
-    #if E_STEPPERS > 1
801
-      SET_E_STEP_DIR(1);
802
-      #if E_STEPPERS > 2
803
-        SET_E_STEP_DIR(2);
804
-        #if E_STEPPERS > 3
805
-          SET_E_STEP_DIR(3);
806
-          #if E_STEPPERS > 4
807
-            SET_E_STEP_DIR(4);
808
-          #endif
809
-        #endif
810
-      #endif
811
-    #endif
770
+    if (current_block->use_advance_lead) {
771
+      if (step_events_completed > LA_decelerate_after && current_adv_steps > final_adv_steps) {
772
+        e_steps--;
773
+        current_adv_steps--;
774
+        nextAdvanceISR = eISR_Rate;
775
+      }
776
+      else if (step_events_completed < LA_decelerate_after && current_adv_steps < max_adv_steps) {
777
+             //step_events_completed <= (uint32_t)current_block->accelerate_until) {
778
+        e_steps++;
779
+        current_adv_steps++;
780
+        nextAdvanceISR = eISR_Rate;
781
+      }
782
+      else {
783
+        nextAdvanceISR = ADV_NEVER;
784
+        eISR_Rate = ADV_NEVER;
785
+      }
786
+    }
787
+    else
788
+      nextAdvanceISR = ADV_NEVER;
789
+
790
+    switch(LA_active_extruder) {
791
+      case 0: SET_E_STEP_DIR(0); break;
792
+      #if EXTRUDERS > 1
793
+        case 1: SET_E_STEP_DIR(1); break;
794
+        #if EXTRUDERS > 2
795
+          case 2: SET_E_STEP_DIR(2); break;
796
+          #if EXTRUDERS > 3
797
+            case 3: SET_E_STEP_DIR(3); break;
798
+            #if EXTRUDERS > 4
799
+              case 4: SET_E_STEP_DIR(4); break;
800
+            #endif // EXTRUDERS > 4
801
+          #endif // EXTRUDERS > 3
802
+        #endif // EXTRUDERS > 2
803
+      #endif // EXTRUDERS > 1
804
+    }
812
 
805
 
813
-    // Step all E steppers that have steps
814
-    for (uint8_t i = step_loops; i--;) {
806
+    // Step E stepper if we have steps
807
+    while (e_steps) {
815
 
808
 
816
       #if EXTRA_CYCLES_E > 20
809
       #if EXTRA_CYCLES_E > 20
817
         hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM);
810
         hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM);
818
       #endif
811
       #endif
819
 
812
 
820
-      START_E_PULSE(0);
821
-      #if E_STEPPERS > 1
822
-        START_E_PULSE(1);
823
-        #if E_STEPPERS > 2
824
-          START_E_PULSE(2);
825
-          #if E_STEPPERS > 3
826
-            START_E_PULSE(3);
827
-            #if E_STEPPERS > 4
828
-              START_E_PULSE(4);
829
-            #endif
830
-          #endif
831
-        #endif
832
-      #endif
813
+      switch(LA_active_extruder) {
814
+        case 0: START_E_PULSE(0); break;
815
+        #if EXTRUDERS > 1
816
+          case 1: START_E_PULSE(1); break;
817
+          #if EXTRUDERS > 2
818
+            case 2: START_E_PULSE(2); break;
819
+            #if EXTRUDERS > 3
820
+              case 3: START_E_PULSE(3); break;
821
+              #if EXTRUDERS > 4
822
+                case 4: START_E_PULSE(4); break;
823
+              #endif // EXTRUDERS > 4
824
+            #endif // EXTRUDERS > 3
825
+          #endif // EXTRUDERS > 2
826
+        #endif // EXTRUDERS > 1
827
+      }
833
 
828
 
834
       // For minimum pulse time wait before stopping pulses
829
       // For minimum pulse time wait before stopping pulses
835
       #if EXTRA_CYCLES_E > 20
830
       #if EXTRA_CYCLES_E > 20
839
         DELAY_NOPS(EXTRA_CYCLES_E);
834
         DELAY_NOPS(EXTRA_CYCLES_E);
840
       #endif
835
       #endif
841
 
836
 
842
-      STOP_E_PULSE(0);
843
-      #if E_STEPPERS > 1
844
-        STOP_E_PULSE(1);
845
-        #if E_STEPPERS > 2
846
-          STOP_E_PULSE(2);
847
-          #if E_STEPPERS > 3
848
-            STOP_E_PULSE(3);
849
-            #if E_STEPPERS > 4
850
-              STOP_E_PULSE(4);
851
-            #endif
852
-          #endif
853
-        #endif
854
-      #endif
837
+      switch(LA_active_extruder) {
838
+        case 0: STOP_E_PULSE(0); break;
839
+        #if EXTRUDERS > 1
840
+          case 1: STOP_E_PULSE(1); break;
841
+          #if EXTRUDERS > 2
842
+            case 2: STOP_E_PULSE(2); break;
843
+            #if EXTRUDERS > 3
844
+              case 3: STOP_E_PULSE(3); break;
845
+              #if EXTRUDERS > 4
846
+                case 4: STOP_E_PULSE(4); break;
847
+              #endif // EXTRUDERS > 4
848
+            #endif // EXTRUDERS > 3
849
+          #endif // EXTRUDERS > 2
850
+        #endif // EXTRUDERS > 1
851
+      }
855
 
852
 
856
       // For minimum pulse time wait before looping
853
       // For minimum pulse time wait before looping
857
       #if EXTRA_CYCLES_E > 20
854
       #if EXTRA_CYCLES_E > 20
1116
 
1113
 
1117
   ENABLE_STEPPER_DRIVER_INTERRUPT();
1114
   ENABLE_STEPPER_DRIVER_INTERRUPT();
1118
 
1115
 
1119
-  #if ENABLED(LIN_ADVANCE)
1120
-    for (uint8_t i = 0; i < COUNT(e_steps); i++) e_steps[i] = 0;
1121
-    ZERO(current_adv_steps);
1122
-  #endif
1123
-
1124
   endstops.enable(true); // Start with endstops active. After homing they can be disabled
1116
   endstops.enable(true); // Start with endstops active. After homing they can be disabled
1125
   sei();
1117
   sei();
1126
 
1118
 

+ 26
- 26
Marlin/src/module/stepper.h 查看文件

98
     static volatile uint32_t step_events_completed; // The number of step events executed in the current block
98
     static volatile uint32_t step_events_completed; // The number of step events executed in the current block
99
 
99
 
100
     #if ENABLED(LIN_ADVANCE)
100
     #if ENABLED(LIN_ADVANCE)
101
+
102
+      static uint32_t LA_decelerate_after; // Copy from current executed block. Needed because current_block is set to NULL "too early".
101
       static hal_timer_t nextMainISR, nextAdvanceISR, eISR_Rate;
103
       static hal_timer_t nextMainISR, nextAdvanceISR, eISR_Rate;
104
+      static uint16_t current_adv_steps, final_adv_steps, max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early".
102
       #define _NEXT_ISR(T) nextMainISR = T
105
       #define _NEXT_ISR(T) nextMainISR = T
106
+      static int8_t e_steps;
107
+      static int8_t LA_active_extruder; // Copy from current executed block. Needed because current_block is set to NULL "too early".
108
+      static bool use_advance_lead;
109
+
110
+    #else // !LIN_ADVANCE
103
 
111
 
104
-      static volatile int e_steps[E_STEPPERS];
105
-      static int final_estep_rate;
106
-      static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s]
107
-      static int current_adv_steps[E_STEPPERS];  // The amount of current added esteps due to advance.
108
-                                                 // i.e., the current amount of pressure applied
109
-                                                 // to the spring (=filament).
110
-    #else
111
       #define _NEXT_ISR(T) HAL_timer_set_compare(STEP_TIMER_NUM, T);
112
       #define _NEXT_ISR(T) HAL_timer_set_compare(STEP_TIMER_NUM, T);
112
-    #endif // LIN_ADVANCE
113
+
114
+    #endif // !LIN_ADVANCE
113
 
115
 
114
     static long acceleration_time, deceleration_time;
116
     static long acceleration_time, deceleration_time;
115
     static uint8_t step_loops, step_loops_nominal;
117
     static uint8_t step_loops, step_loops_nominal;
239
       FORCE_INLINE static void set_x_lock(const bool state) { locked_x_motor = state; }
241
       FORCE_INLINE static void set_x_lock(const bool state) { locked_x_motor = state; }
240
       FORCE_INLINE static void set_x2_lock(const bool state) { locked_x2_motor = state; }
242
       FORCE_INLINE static void set_x2_lock(const bool state) { locked_x2_motor = state; }
241
     #endif
243
     #endif
242
-
243
     #if ENABLED(Y_DUAL_ENDSTOPS)
244
     #if ENABLED(Y_DUAL_ENDSTOPS)
244
       FORCE_INLINE static void set_homing_flag_y(const bool state) { performing_homing = state; }
245
       FORCE_INLINE static void set_homing_flag_y(const bool state) { performing_homing = state; }
245
       FORCE_INLINE static void set_y_lock(const bool state) { locked_y_motor = state; }
246
       FORCE_INLINE static void set_y_lock(const bool state) { locked_y_motor = state; }
246
       FORCE_INLINE static void set_y2_lock(const bool state) { locked_y2_motor = state; }
247
       FORCE_INLINE static void set_y2_lock(const bool state) { locked_y2_motor = state; }
247
     #endif
248
     #endif
248
-
249
     #if ENABLED(Z_DUAL_ENDSTOPS)
249
     #if ENABLED(Z_DUAL_ENDSTOPS)
250
       FORCE_INLINE static void set_homing_flag_z(const bool state) { performing_homing = state; }
250
       FORCE_INLINE static void set_homing_flag_z(const bool state) { performing_homing = state; }
251
       FORCE_INLINE static void set_z_lock(const bool state) { locked_z_motor = state; }
251
       FORCE_INLINE static void set_z_lock(const bool state) { locked_z_motor = state; }
351
 
351
 
352
       static int8_t last_extruder = -1;
352
       static int8_t last_extruder = -1;
353
 
353
 
354
+      #if ENABLED(LIN_ADVANCE)
355
+        if (current_block->active_extruder != last_extruder) {
356
+          current_adv_steps = 0; // If the now active extruder wasn't in use during the last move, its pressure is most likely gone.
357
+          LA_active_extruder = current_block->active_extruder;
358
+        }
359
+
360
+        if (current_block->use_advance_lead) {
361
+          LA_decelerate_after = current_block->decelerate_after;
362
+          final_adv_steps = current_block->final_adv_steps;
363
+          max_adv_steps = current_block->max_adv_steps;
364
+          use_advance_lead = true;
365
+        }
366
+        else
367
+          use_advance_lead = false;
368
+      #endif
369
+
354
       if (current_block->direction_bits != last_direction_bits || current_block->active_extruder != last_extruder) {
370
       if (current_block->direction_bits != last_direction_bits || current_block->active_extruder != last_extruder) {
355
         last_direction_bits = current_block->direction_bits;
371
         last_direction_bits = current_block->direction_bits;
356
         last_extruder = current_block->active_extruder;
372
         last_extruder = current_block->active_extruder;
366
       acceleration_time = calc_timer_interval(acc_step_rate);
382
       acceleration_time = calc_timer_interval(acc_step_rate);
367
       _NEXT_ISR(acceleration_time);
383
       _NEXT_ISR(acceleration_time);
368
 
384
 
369
-      #if ENABLED(LIN_ADVANCE)
370
-        if (current_block->use_advance_lead) {
371
-          current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
372
-          final_estep_rate = (current_block->nominal_rate * current_block->abs_adv_steps_multiplier8) >> 17;
373
-        }
374
-      #endif
375
-
376
-      // SERIAL_ECHO_START();
377
-      // SERIAL_ECHOPGM("advance :");
378
-      // SERIAL_ECHO(current_block->advance/256.0);
379
-      // SERIAL_ECHOPGM("advance rate :");
380
-      // SERIAL_ECHO(current_block->advance_rate/256.0);
381
-      // SERIAL_ECHOPGM("initial advance :");
382
-      // SERIAL_ECHO(current_block->initial_advance/256.0);
383
-      // SERIAL_ECHOPGM("final advance :");
384
-      // SERIAL_ECHOLN(current_block->final_advance/256.0);
385
     }
385
     }
386
 
386
 
387
     #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
387
     #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM

正在加载...
取消
保存