瀏覽代碼

Remove legacy ADVANCE feature

Scott Lahteine 7 年之前
父節點
當前提交
cbfcce09fa
共有 35 個檔案被更改,包括 48 行新增601 行删除
  1. 1
    6
      Marlin/Conditionals_post.h
  2. 0
    14
      Marlin/Configuration_adv.h
  3. 2
    7
      Marlin/SanityCheck.h
  4. 0
    14
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  5. 0
    14
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  6. 0
    14
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  7. 0
    14
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  8. 0
    14
      Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
  9. 0
    14
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  10. 0
    14
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  11. 0
    14
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  12. 0
    14
      Marlin/example_configurations/Felix/Configuration_adv.h
  13. 0
    14
      Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h
  14. 0
    14
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  15. 0
    14
      Marlin/example_configurations/Malyan/M150/Configuration_adv.h
  16. 0
    14
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  17. 0
    14
      Marlin/example_configurations/SCARA/Configuration_adv.h
  18. 0
    14
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  19. 0
    14
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  20. 0
    14
      Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
  21. 0
    14
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  22. 0
    14
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  23. 0
    14
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  24. 0
    14
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  25. 0
    14
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  26. 0
    14
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  27. 0
    14
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  28. 0
    14
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  29. 0
    14
      Marlin/example_configurations/makibox/Configuration_adv.h
  30. 0
    14
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  31. 0
    14
      Marlin/example_configurations/wt150/Configuration_adv.h
  32. 1
    25
      Marlin/planner.cpp
  33. 0
    5
      Marlin/planner.h
  34. 31
    116
      Marlin/stepper.cpp
  35. 13
    36
      Marlin/stepper.h

+ 1
- 6
Marlin/Conditionals_post.h 查看文件

227
   #define MICROSTEP16 HIGH,HIGH
227
   #define MICROSTEP16 HIGH,HIGH
228
 
228
 
229
   /**
229
   /**
230
-   * Advance calculated values
230
+   * Override here because this is set in Configuration_adv.h
231
    */
231
    */
232
-  #if ENABLED(ADVANCE)
233
-    #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
234
-    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS_N] / (EXTRUSION_AREA))
235
-  #endif
236
-
237
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
232
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
238
     #undef SD_DETECT_INVERTED
233
     #undef SD_DETECT_INVERTED
239
   #endif
234
   #endif

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

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 2
- 7
Marlin/SanityCheck.h 查看文件

208
   #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
208
   #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
209
 #elif defined(MIN_RETRACT)
209
 #elif defined(MIN_RETRACT)
210
   #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
210
   #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
211
+#elif defined(ADVANCE)
212
+  #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
211
 #endif
213
 #endif
212
 
214
 
213
 /**
215
 /**
816
 #endif // DISABLE_[XYZ]
818
 #endif // DISABLE_[XYZ]
817
 
819
 
818
 /**
820
 /**
819
- * Advance Extrusion
820
- */
821
-#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE)
822
-  #error "You can enable ADVANCE or LIN_ADVANCE, but not both."
823
-#endif
824
-
825
-/**
826
  * Filament Width Sensor
821
  * Filament Width Sensor
827
  */
822
  */
828
 #if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR
823
 #if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR

+ 0
- 14
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Anet/A6/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Anet/A8/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 1.75
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 1.75
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Cartesio/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Creality/CR-10/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Felix/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Malyan/M150/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/RigidBot/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 1.75
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/SCARA/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 1.75
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Sanguinololu/Configuration_adv.h 查看文件

603
 
603
 
604
 // @section extruder
604
 // @section extruder
605
 
605
 
606
-// extruder advance constant (s2/mm3)
607
-//
608
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
609
-//
610
-// Hooke's law says:    force = k * distance
611
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
612
-// so: v ^ 2 is proportional to number of steps we advance the extruder
613
-//#define ADVANCE
614
-
615
-#if ENABLED(ADVANCE)
616
-  #define EXTRUDER_ADVANCE_K .0
617
-  #define D_FILAMENT 2.85
618
-#endif
619
-
620
 /**
606
 /**
621
  * Implementation of linear pressure control
607
  * Implementation of linear pressure control
622
  *
608
  *

+ 0
- 14
Marlin/example_configurations/TinyBoy2/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/Velleman/K8200/Configuration_adv.h 查看文件

627
 
627
 
628
 // @section extruder
628
 // @section extruder
629
 
629
 
630
-// extruder advance constant (s2/mm3)
631
-//
632
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
633
-//
634
-// Hooke's law says:    force = k * distance
635
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
636
-// so: v ^ 2 is proportional to number of steps we advance the extruder
637
-//#define ADVANCE
638
-
639
-#if ENABLED(ADVANCE)
640
-  #define EXTRUDER_ADVANCE_K .0
641
-  #define D_FILAMENT 2.85
642
-#endif
643
-
644
 /**
630
 /**
645
  * Implementation of linear pressure control
631
  * Implementation of linear pressure control
646
  *
632
  *

+ 0
- 14
Marlin/example_configurations/Velleman/K8400/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h 查看文件

616
 
616
 
617
 // @section extruder
617
 // @section extruder
618
 
618
 
619
-// extruder advance constant (s2/mm3)
620
-//
621
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
622
-//
623
-// Hooke's law says:    force = k * distance
624
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
625
-// so: v ^ 2 is proportional to number of steps we advance the extruder
626
-//#define ADVANCE
627
-
628
-#if ENABLED(ADVANCE)
629
-  #define EXTRUDER_ADVANCE_K .0
630
-  #define D_FILAMENT 2.85
631
-#endif
632
-
633
 /**
619
 /**
634
  * Implementation of linear pressure control
620
  * Implementation of linear pressure control
635
  *
621
  *

+ 0
- 14
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h 查看文件

616
 
616
 
617
 // @section extruder
617
 // @section extruder
618
 
618
 
619
-// extruder advance constant (s2/mm3)
620
-//
621
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
622
-//
623
-// Hooke's law says:    force = k * distance
624
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
625
-// so: v ^ 2 is proportional to number of steps we advance the extruder
626
-//#define ADVANCE
627
-
628
-#if ENABLED(ADVANCE)
629
-  #define EXTRUDER_ADVANCE_K .0
630
-  #define D_FILAMENT 2.85
631
-#endif
632
-
633
 /**
619
 /**
634
  * Implementation of linear pressure control
620
  * Implementation of linear pressure control
635
  *
621
  *

+ 0
- 14
Marlin/example_configurations/delta/generic/Configuration_adv.h 查看文件

616
 
616
 
617
 // @section extruder
617
 // @section extruder
618
 
618
 
619
-// extruder advance constant (s2/mm3)
620
-//
621
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
622
-//
623
-// Hooke's law says:    force = k * distance
624
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
625
-// so: v ^ 2 is proportional to number of steps we advance the extruder
626
-//#define ADVANCE
627
-
628
-#if ENABLED(ADVANCE)
629
-  #define EXTRUDER_ADVANCE_K .0
630
-  #define D_FILAMENT 2.85
631
-#endif
632
-
633
 /**
619
 /**
634
  * Implementation of linear pressure control
620
  * Implementation of linear pressure control
635
  *
621
  *

+ 0
- 14
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h 查看文件

616
 
616
 
617
 // @section extruder
617
 // @section extruder
618
 
618
 
619
-// extruder advance constant (s2/mm3)
620
-//
621
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
622
-//
623
-// Hooke's law says:    force = k * distance
624
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
625
-// so: v ^ 2 is proportional to number of steps we advance the extruder
626
-//#define ADVANCE
627
-
628
-#if ENABLED(ADVANCE)
629
-  #define EXTRUDER_ADVANCE_K .0
630
-  #define D_FILAMENT 2.85
631
-#endif
632
-
633
 /**
619
 /**
634
  * Implementation of linear pressure control
620
  * Implementation of linear pressure control
635
  *
621
  *

+ 0
- 14
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h 查看文件

621
 
621
 
622
 // @section extruder
622
 // @section extruder
623
 
623
 
624
-// extruder advance constant (s2/mm3)
625
-//
626
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
627
-//
628
-// Hooke's law says:    force = k * distance
629
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
630
-// so: v ^ 2 is proportional to number of steps we advance the extruder
631
-//#define ADVANCE
632
-
633
-#if ENABLED(ADVANCE)
634
-  #define EXTRUDER_ADVANCE_K .0
635
-  #define D_FILAMENT 2.85
636
-#endif
637
-
638
 /**
624
 /**
639
  * Implementation of linear pressure control
625
  * Implementation of linear pressure control
640
  *
626
  *

+ 0
- 14
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h 查看文件

616
 
616
 
617
 // @section extruder
617
 // @section extruder
618
 
618
 
619
-// extruder advance constant (s2/mm3)
620
-//
621
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
622
-//
623
-// Hooke's law says:    force = k * distance
624
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
625
-// so: v ^ 2 is proportional to number of steps we advance the extruder
626
-//#define ADVANCE
627
-
628
-#if ENABLED(ADVANCE)
629
-  #define EXTRUDER_ADVANCE_K .0
630
-  #define D_FILAMENT 2.85
631
-#endif
632
-
633
 /**
619
 /**
634
  * Implementation of linear pressure control
620
  * Implementation of linear pressure control
635
  *
621
  *

+ 0
- 14
Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/makibox/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 0
- 14
Marlin/example_configurations/wt150/Configuration_adv.h 查看文件

614
 
614
 
615
 // @section extruder
615
 // @section extruder
616
 
616
 
617
-// extruder advance constant (s2/mm3)
618
-//
619
-// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
620
-//
621
-// Hooke's law says:    force = k * distance
622
-// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
623
-// so: v ^ 2 is proportional to number of steps we advance the extruder
624
-//#define ADVANCE
625
-
626
-#if ENABLED(ADVANCE)
627
-  #define EXTRUDER_ADVANCE_K .0
628
-  #define D_FILAMENT 2.85
629
-#endif
630
-
631
 /**
617
 /**
632
  * Implementation of linear pressure control
618
  * Implementation of linear pressure control
633
  *
619
  *

+ 1
- 25
Marlin/planner.cpp 查看文件

211
     block->decelerate_after = accelerate_steps + plateau_steps;
211
     block->decelerate_after = accelerate_steps + plateau_steps;
212
     block->initial_rate = initial_rate;
212
     block->initial_rate = initial_rate;
213
     block->final_rate = final_rate;
213
     block->final_rate = final_rate;
214
-    #if ENABLED(ADVANCE)
215
-      block->initial_advance = block->advance * sq(entry_factor);
216
-      block->final_advance = block->advance * sq(exit_factor);
217
-    #endif
218
   }
214
   }
219
   CRITICAL_SECTION_END;
215
   CRITICAL_SECTION_END;
220
 }
216
 }
1405
         * axis_steps_per_mm[E_AXIS_N] * 256.0
1401
         * axis_steps_per_mm[E_AXIS_N] * 256.0
1406
       );
1402
       );
1407
 
1403
 
1408
-  #elif ENABLED(ADVANCE)
1409
-
1410
-    // Calculate advance rate
1411
-    if (esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS])) {
1412
-      const long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2);
1413
-      const float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(current_speed[E_AXIS], EXTRUSION_AREA) * 256;
1414
-      block->advance = advance;
1415
-      block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
1416
-    }
1417
-    else
1418
-      block->advance_rate = block->advance = 0;
1419
-
1420
-    /**
1421
-     SERIAL_ECHO_START();
1422
-     SERIAL_ECHOPGM("advance :");
1423
-     SERIAL_ECHO(block->advance/256.0);
1424
-     SERIAL_ECHOPGM("advance rate :");
1425
-     SERIAL_ECHOLN(block->advance_rate/256.0);
1426
-     */
1427
-
1428
-  #endif // ADVANCE or LIN_ADVANCE
1404
+  #endif // LIN_ADVANCE
1429
 
1405
 
1430
   calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed);
1406
   calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed);
1431
 
1407
 

+ 0
- 5
Marlin/planner.h 查看文件

96
   #if ENABLED(LIN_ADVANCE)
96
   #if ENABLED(LIN_ADVANCE)
97
     bool use_advance_lead;
97
     bool use_advance_lead;
98
     uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float
98
     uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float
99
-  #elif ENABLED(ADVANCE)
100
-    int32_t advance_rate;
101
-    volatile int32_t initial_advance;
102
-    volatile int32_t final_advance;
103
-    float advance;
104
   #endif
99
   #endif
105
 
100
 
106
   // Fields used by the motion planner to manage acceleration
101
   // Fields used by the motion planner to manage acceleration

+ 31
- 116
Marlin/stepper.cpp 查看文件

97
 
97
 
98
 volatile uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block
98
 volatile uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block
99
 
99
 
100
-#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
100
+#if ENABLED(LIN_ADVANCE)
101
 
101
 
102
   constexpr uint16_t ADV_NEVER = 65535;
102
   constexpr uint16_t ADV_NEVER = 65535;
103
 
103
 
105
            Stepper::nextAdvanceISR = ADV_NEVER,
105
            Stepper::nextAdvanceISR = ADV_NEVER,
106
            Stepper::eISR_Rate = ADV_NEVER;
106
            Stepper::eISR_Rate = ADV_NEVER;
107
 
107
 
108
-  #if ENABLED(LIN_ADVANCE)
109
-    volatile int Stepper::e_steps[E_STEPPERS];
110
-    int Stepper::final_estep_rate,
111
-        Stepper::current_estep_rate[E_STEPPERS],
112
-        Stepper::current_adv_steps[E_STEPPERS];
113
-  #else
114
-    long Stepper::e_steps[E_STEPPERS],
115
-         Stepper::final_advance = 0,
116
-         Stepper::old_advance = 0,
117
-         Stepper::advance_rate,
118
-         Stepper::advance;
119
-  #endif
108
+  volatile int Stepper::e_steps[E_STEPPERS];
109
+  int Stepper::final_estep_rate,
110
+      Stepper::current_estep_rate[E_STEPPERS],
111
+      Stepper::current_adv_steps[E_STEPPERS];
120
 
112
 
121
   /**
113
   /**
122
    * See https://github.com/MarlinFirmware/Marlin/issues/5699#issuecomment-309264382
114
    * See https://github.com/MarlinFirmware/Marlin/issues/5699#issuecomment-309264382
133
     return ADV_NEVER;
125
     return ADV_NEVER;
134
   }
126
   }
135
 
127
 
136
-#endif // ADVANCE || LIN_ADVANCE
128
+#endif // LIN_ADVANCE
137
 
129
 
138
 long Stepper::acceleration_time, Stepper::deceleration_time;
130
 long Stepper::acceleration_time, Stepper::deceleration_time;
139
 
131
 
325
     SET_STEP_DIR(Z); // C
317
     SET_STEP_DIR(Z); // C
326
   #endif
318
   #endif
327
 
319
 
328
-  #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
320
+  #if DISABLED(LIN_ADVANCE)
329
     if (motor_direction(E_AXIS)) {
321
     if (motor_direction(E_AXIS)) {
330
       REV_E_DIR();
322
       REV_E_DIR();
331
       count_direction[E_AXIS] = -1;
323
       count_direction[E_AXIS] = -1;
334
       NORM_E_DIR();
326
       NORM_E_DIR();
335
       count_direction[E_AXIS] = 1;
327
       count_direction[E_AXIS] = 1;
336
     }
328
     }
337
-  #endif // !ADVANCE && !LIN_ADVANCE
329
+  #endif // !LIN_ADVANCE
338
 }
330
 }
339
 
331
 
340
 #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
332
 #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
356
  *  4000   500  Hz - init rate
348
  *  4000   500  Hz - init rate
357
  */
349
  */
358
 ISR(TIMER1_COMPA_vect) {
350
 ISR(TIMER1_COMPA_vect) {
359
-  #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
351
+  #if ENABLED(LIN_ADVANCE)
360
     Stepper::advance_isr_scheduler();
352
     Stepper::advance_isr_scheduler();
361
   #else
353
   #else
362
     Stepper::isr();
354
     Stepper::isr();
372
   #define ENDSTOP_NOMINAL_OCR_VAL 3000    // check endstops every 1.5ms to guarantee two stepper ISRs within 5ms for BLTouch
364
   #define ENDSTOP_NOMINAL_OCR_VAL 3000    // check endstops every 1.5ms to guarantee two stepper ISRs within 5ms for BLTouch
373
   #define OCR_VAL_TOLERANCE 1000          // First max delay is 2.0ms, last min delay is 0.5ms, all others 1.5ms
365
   #define OCR_VAL_TOLERANCE 1000          // First max delay is 2.0ms, last min delay is 0.5ms, all others 1.5ms
374
 
366
 
375
-  #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
367
+  #if DISABLED(LIN_ADVANCE)
376
     // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars)
368
     // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars)
377
     CBI(TIMSK0, OCIE0B); // Temperature ISR
369
     CBI(TIMSK0, OCIE0B); // Temperature ISR
378
     DISABLE_STEPPER_DRIVER_INTERRUPT();
370
     DISABLE_STEPPER_DRIVER_INTERRUPT();
455
           return;
447
           return;
456
         }
448
         }
457
       #endif
449
       #endif
458
-
459
-      // #if ENABLED(ADVANCE)
460
-      //   e_steps[TOOL_E_INDEX] = 0;
461
-      // #endif
462
     }
450
     }
463
     else {
451
     else {
464
       _NEXT_ISR(2000); // Run at slow speed - 1 KHz
452
       _NEXT_ISR(2000); // Run at slow speed - 1 KHz
504
         }
492
         }
505
       #endif
493
       #endif
506
 
494
 
507
-    #elif ENABLED(ADVANCE)
508
-
509
-      // Always count the unified E axis
510
-      counter_E += current_block->steps[E_AXIS];
511
-      if (counter_E > 0) {
512
-        counter_E -= current_block->step_event_count;
513
-        #if DISABLED(MIXING_EXTRUDER)
514
-          // Don't step E here for mixing extruder
515
-          motor_direction(E_AXIS) ? --e_steps[TOOL_E_INDEX] : ++e_steps[TOOL_E_INDEX];
516
-        #endif
517
-      }
518
-
519
-      #if ENABLED(MIXING_EXTRUDER)
520
-
521
-        // Step mixing steppers proportionally
522
-        const bool dir = motor_direction(E_AXIS);
523
-        MIXING_STEPPERS_LOOP(j) {
524
-          counter_m[j] += current_block->steps[E_AXIS];
525
-          if (counter_m[j] > 0) {
526
-            counter_m[j] -= current_block->mix_event_count[j];
527
-            dir ? --e_steps[j] : ++e_steps[j];
528
-          }
529
-        }
530
-
531
-      #endif // MIXING_EXTRUDER
532
-
533
-    #endif // ADVANCE or LIN_ADVANCE
495
+    #endif // LIN_ADVANCE
534
 
496
 
535
     #define _COUNTER(AXIS) counter_## AXIS
497
     #define _COUNTER(AXIS) counter_## AXIS
536
     #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
498
     #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
591
     #else
553
     #else
592
       #define _CYCLE_APPROX_6 _CYCLE_APPROX_5
554
       #define _CYCLE_APPROX_6 _CYCLE_APPROX_5
593
     #endif
555
     #endif
594
-    #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
556
+    #if DISABLED(LIN_ADVANCE)
595
       #if ENABLED(MIXING_EXTRUDER)
557
       #if ENABLED(MIXING_EXTRUDER)
596
         #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6
558
         #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6
597
       #else
559
       #else
627
     #endif
589
     #endif
628
 
590
 
629
     // For non-advance use linear interpolation for E also
591
     // For non-advance use linear interpolation for E also
630
-    #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
592
+    #if DISABLED(LIN_ADVANCE)
631
       #if ENABLED(MIXING_EXTRUDER)
593
       #if ENABLED(MIXING_EXTRUDER)
632
         // Keep updating the single E axis
594
         // Keep updating the single E axis
633
         counter_E += current_block->steps[E_AXIS];
595
         counter_E += current_block->steps[E_AXIS];
641
       #else // !MIXING_EXTRUDER
603
       #else // !MIXING_EXTRUDER
642
         PULSE_START(E);
604
         PULSE_START(E);
643
       #endif
605
       #endif
644
-    #endif // !ADVANCE && !LIN_ADVANCE
606
+    #endif // !LIN_ADVANCE
645
 
607
 
646
     // For minimum pulse time wait before stopping pulses
608
     // For minimum pulse time wait before stopping pulses
647
     #if EXTRA_CYCLES_XYZE > 20
609
     #if EXTRA_CYCLES_XYZE > 20
661
       PULSE_STOP(Z);
623
       PULSE_STOP(Z);
662
     #endif
624
     #endif
663
 
625
 
664
-    #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
626
+    #if DISABLED(LIN_ADVANCE)
665
       #if ENABLED(MIXING_EXTRUDER)
627
       #if ENABLED(MIXING_EXTRUDER)
666
         // Always step the single E axis
628
         // Always step the single E axis
667
         if (counter_E > 0) {
629
         if (counter_E > 0) {
677
       #else // !MIXING_EXTRUDER
639
       #else // !MIXING_EXTRUDER
678
         PULSE_STOP(E);
640
         PULSE_STOP(E);
679
       #endif
641
       #endif
680
-    #endif // !ADVANCE && !LIN_ADVANCE
642
+    #endif // !LIN_ADVANCE
681
 
643
 
682
     if (++step_events_completed >= current_block->step_event_count) {
644
     if (++step_events_completed >= current_block->step_event_count) {
683
       all_steps_done = true;
645
       all_steps_done = true;
694
   } // steps_loop
656
   } // steps_loop
695
 
657
 
696
   #if ENABLED(LIN_ADVANCE)
658
   #if ENABLED(LIN_ADVANCE)
659
+
697
     if (current_block->use_advance_lead) {
660
     if (current_block->use_advance_lead) {
698
       const int delta_adv_steps = current_estep_rate[TOOL_E_INDEX] - current_adv_steps[TOOL_E_INDEX];
661
       const int delta_adv_steps = current_estep_rate[TOOL_E_INDEX] - current_adv_steps[TOOL_E_INDEX];
699
       current_adv_steps[TOOL_E_INDEX] += delta_adv_steps;
662
       current_adv_steps[TOOL_E_INDEX] += delta_adv_steps;
705
         // For most extruders, advance the single E stepper
668
         // For most extruders, advance the single E stepper
706
         e_steps[TOOL_E_INDEX] += delta_adv_steps;
669
         e_steps[TOOL_E_INDEX] += delta_adv_steps;
707
       #endif
670
       #endif
708
-   }
709
-  #endif
710
-
711
-  #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
671
+    }
712
     // If we have esteps to execute, fire the next advance_isr "now"
672
     // If we have esteps to execute, fire the next advance_isr "now"
713
     if (e_steps[TOOL_E_INDEX]) nextAdvanceISR = 0;
673
     if (e_steps[TOOL_E_INDEX]) nextAdvanceISR = 0;
714
-  #endif
674
+
675
+  #endif // LIN_ADVANCE
715
 
676
 
716
   // Calculate new timer value
677
   // Calculate new timer value
717
   if (step_events_completed <= (uint32_t)current_block->accelerate_until) {
678
   if (step_events_completed <= (uint32_t)current_block->accelerate_until) {
740
           current_estep_rate[TOOL_E_INDEX] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
701
           current_estep_rate[TOOL_E_INDEX] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
741
         #endif
702
         #endif
742
       }
703
       }
743
-
744
-    #elif ENABLED(ADVANCE)
745
-
746
-      advance += advance_rate * step_loops;
747
-      //NOLESS(advance, current_block->advance);
748
-
749
-      const long advance_whole = advance >> 8,
750
-                 advance_factor = advance_whole - old_advance;
751
-
752
-      // Do E steps + advance steps
753
-      #if ENABLED(MIXING_EXTRUDER)
754
-        // ...for mixing steppers proportionally
755
-        MIXING_STEPPERS_LOOP(j)
756
-          e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
757
-      #else
758
-        // ...for the active extruder
759
-        e_steps[TOOL_E_INDEX] += advance_factor;
760
-      #endif
761
-
762
-      old_advance = advance_whole;
763
-
764
-    #endif // ADVANCE or LIN_ADVANCE
765
-
766
-    #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
767
       eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops);
704
       eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops);
768
-    #endif
705
+
706
+    #endif // LIN_ADVANCE
769
   }
707
   }
770
   else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
708
   else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
771
     uint16_t step_rate;
709
     uint16_t step_rate;
796
           current_estep_rate[TOOL_E_INDEX] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
734
           current_estep_rate[TOOL_E_INDEX] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8) >> 17;
797
         #endif
735
         #endif
798
       }
736
       }
799
-
800
-    #elif ENABLED(ADVANCE)
801
-
802
-      advance -= advance_rate * step_loops;
803
-      NOLESS(advance, final_advance);
804
-
805
-      // Do E steps + advance steps
806
-      const long advance_whole = advance >> 8,
807
-                 advance_factor = advance_whole - old_advance;
808
-
809
-      #if ENABLED(MIXING_EXTRUDER)
810
-        MIXING_STEPPERS_LOOP(j)
811
-          e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
812
-      #else
813
-        e_steps[TOOL_E_INDEX] += advance_factor;
814
-      #endif
815
-
816
-      old_advance = advance_whole;
817
-
818
-    #endif // ADVANCE or LIN_ADVANCE
819
-
820
-    #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
821
       eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops);
737
       eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops);
822
-    #endif
738
+
739
+    #endif // LIN_ADVANCE
823
   }
740
   }
824
   else {
741
   else {
825
 
742
 
839
     step_loops = step_loops_nominal;
756
     step_loops = step_loops_nominal;
840
   }
757
   }
841
 
758
 
842
-  #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
759
+  #if DISABLED(LIN_ADVANCE)
843
     NOLESS(OCR1A, TCNT1 + 16);
760
     NOLESS(OCR1A, TCNT1 + 16);
844
   #endif
761
   #endif
845
 
762
 
848
     current_block = NULL;
765
     current_block = NULL;
849
     planner.discard_current_block();
766
     planner.discard_current_block();
850
   }
767
   }
851
-  #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
768
+  #if DISABLED(LIN_ADVANCE)
852
     _ENABLE_ISRs(); // re-enable ISRs
769
     _ENABLE_ISRs(); // re-enable ISRs
853
   #endif
770
   #endif
854
 }
771
 }
855
 
772
 
856
-#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
773
+#if ENABLED(LIN_ADVANCE)
857
 
774
 
858
   #define CYCLES_EATEN_E (E_STEPPERS * 5)
775
   #define CYCLES_EATEN_E (E_STEPPERS * 5)
859
   #define EXTRA_CYCLES_E (STEP_PULSE_CYCLES - (CYCLES_EATEN_E))
776
   #define EXTRA_CYCLES_E (STEP_PULSE_CYCLES - (CYCLES_EATEN_E))
987
     _ENABLE_ISRs();
904
     _ENABLE_ISRs();
988
   }
905
   }
989
 
906
 
990
-#endif // ADVANCE or LIN_ADVANCE
907
+#endif // LIN_ADVANCE
991
 
908
 
992
 void Stepper::init() {
909
 void Stepper::init() {
993
 
910
 
1170
   TCNT1 = 0;
1087
   TCNT1 = 0;
1171
   ENABLE_STEPPER_DRIVER_INTERRUPT();
1088
   ENABLE_STEPPER_DRIVER_INTERRUPT();
1172
 
1089
 
1173
-  #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
1090
+  #if ENABLED(LIN_ADVANCE)
1174
     for (uint8_t i = 0; i < COUNT(e_steps); i++) e_steps[i] = 0;
1091
     for (uint8_t i = 0; i < COUNT(e_steps); i++) e_steps[i] = 0;
1175
-    #if ENABLED(LIN_ADVANCE)
1176
-      ZERO(current_adv_steps);
1177
-    #endif
1178
-  #endif // ADVANCE || LIN_ADVANCE
1092
+    ZERO(current_adv_steps);
1093
+  #endif
1179
 
1094
 
1180
   endstops.enable(true); // Start with endstops active. After homing they can be disabled
1095
   endstops.enable(true); // Start with endstops active. After homing they can be disabled
1181
   sei();
1096
   sei();

+ 13
- 36
Marlin/stepper.h 查看文件

111
     static long counter_X, counter_Y, counter_Z, counter_E;
111
     static long counter_X, counter_Y, counter_Z, counter_E;
112
     static volatile uint32_t step_events_completed; // The number of step events executed in the current block
112
     static volatile uint32_t step_events_completed; // The number of step events executed in the current block
113
 
113
 
114
-    #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
114
+    #if ENABLED(LIN_ADVANCE)
115
+
115
       static uint16_t nextMainISR, nextAdvanceISR, eISR_Rate;
116
       static uint16_t nextMainISR, nextAdvanceISR, eISR_Rate;
116
       #define _NEXT_ISR(T) nextMainISR = T
117
       #define _NEXT_ISR(T) nextMainISR = T
117
-      #if ENABLED(LIN_ADVANCE)
118
-        static volatile int e_steps[E_STEPPERS];
119
-        static int final_estep_rate;
120
-        static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s]
121
-        static int current_adv_steps[E_STEPPERS];  // The amount of current added esteps due to advance.
122
-                                                   // i.e., the current amount of pressure applied
123
-                                                   // to the spring (=filament).
124
-      #else
125
-        static long e_steps[E_STEPPERS];
126
-        static long advance_rate, advance, final_advance;
127
-        static long old_advance;
128
-      #endif
129
-    #else
118
+      static volatile int e_steps[E_STEPPERS];
119
+      static int final_estep_rate;
120
+      static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s]
121
+      static int current_adv_steps[E_STEPPERS];  // The amount of current added esteps due to advance.
122
+                                                 // i.e., the current amount of pressure applied
123
+                                                 // to the spring (=filament).
124
+    #else // !LIN_ADVANCE
125
+
130
       #define _NEXT_ISR(T) OCR1A = T
126
       #define _NEXT_ISR(T) OCR1A = T
131
-    #endif // ADVANCE or LIN_ADVANCE
127
+
128
+    #endif // !LIN_ADVANCE
132
 
129
 
133
     static long acceleration_time, deceleration_time;
130
     static long acceleration_time, deceleration_time;
134
     //unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
131
     //unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
177
 
174
 
178
     static void isr();
175
     static void isr();
179
 
176
 
180
-    #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
177
+    #if ENABLED(LIN_ADVANCE)
181
       static void advance_isr();
178
       static void advance_isr();
182
       static void advance_isr_scheduler();
179
       static void advance_isr_scheduler();
183
     #endif
180
     #endif
337
         set_directions();
334
         set_directions();
338
       }
335
       }
339
 
336
 
340
-      #if ENABLED(ADVANCE)
341
-
342
-        advance = current_block->initial_advance;
343
-        final_advance = current_block->final_advance;
344
-
345
-        // Do E steps + advance steps
346
-        #if ENABLED(MIXING_EXTRUDER)
347
-          long advance_factor = (advance >> 8) - old_advance;
348
-          // ...for mixing steppers proportionally
349
-          MIXING_STEPPERS_LOOP(j)
350
-            e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
351
-        #else
352
-          // ...for the active extruder
353
-          e_steps[TOOL_E_INDEX] += ((advance >> 8) - old_advance);
354
-        #endif
355
-
356
-        old_advance = advance >> 8;
357
-
358
-      #endif
359
-
360
       deceleration_time = 0;
337
       deceleration_time = 0;
361
       // step_rate to timer interval
338
       // step_rate to timer interval
362
       OCR1A_nominal = calc_timer(current_block->nominal_rate);
339
       OCR1A_nominal = calc_timer(current_block->nominal_rate);

Loading…
取消
儲存