Преглед изворни кода

Adaptive multiaxis step smoothing

- Stepper bugs fixed
- Support MIXING_EXTRUDER with Linear Advance
- Miscellaneous cleanup
etagle пре 6 година
родитељ
комит
39a7e7720d
57 измењених фајлова са 1281 додато и 486 уклоњено
  1. 8
    0
      Marlin/Configuration_adv.h
  2. 8
    0
      Marlin/src/config/default/Configuration_adv.h
  3. 8
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  4. 8
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  5. 8
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  6. 8
    0
      Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h
  7. 8
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  8. 8
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h
  9. 8
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  10. 8
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  11. 8
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  12. 8
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  13. 8
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  14. 8
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h
  15. 8
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h
  16. 8
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h
  17. 8
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h
  18. 8
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h
  19. 8
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h
  20. 8
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  21. 8
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  22. 8
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
  23. 8
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
  24. 8
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  25. 8
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h
  26. 1
    1
      Marlin/src/config/examples/MakerParts/Configuration.h
  27. 8
    0
      Marlin/src/config/examples/MakerParts/Configuration_adv.h
  28. 8
    0
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  29. 8
    0
      Marlin/src/config/examples/Malyan/M200/Configuration_adv.h
  30. 8
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  31. 8
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  32. 8
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  33. 8
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  34. 8
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  35. 8
    0
      Marlin/src/config/examples/TheBorg/Configuration_adv.h
  36. 8
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  37. 8
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  38. 8
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  39. 8
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  40. 8
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  41. 8
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  42. 8
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h
  43. 8
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  44. 8
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  45. 8
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  46. 8
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h
  47. 8
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  48. 8
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  49. 8
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  50. 8
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  51. 8
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  52. 128
    42
      Marlin/src/inc/Conditionals_post.h
  53. 10
    4
      Marlin/src/module/planner.cpp
  54. 2
    2
      Marlin/src/module/planner.h
  55. 396
    381
      Marlin/src/module/stepper.cpp
  56. 75
    56
      Marlin/src/module/stepper.h
  57. 269
    0
      docs/Bresenham.md

+ 8
- 0
Marlin/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/default/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 4, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 1
- 1
Marlin/src/config/examples/MakerParts/Configuration.h Прегледај датотеку

@@ -631,7 +631,7 @@
631 631
  * Override with M201
632 632
  *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
633 633
  */
634
-#define DEFAULT_MAX_ACCELERATION        { MAX_XYAXIS_ACCEL, MAX_XYAXIS_ACCEL, 100, 200 }
634
+#define DEFAULT_MAX_ACCELERATION        { MAX_XYAXIS_ACCEL, MAX_XYAXIS_ACCEL, 10, 200 }
635 635
 
636 636
 /**
637 637
  * Default Acceleration (change/s) change = mm/s

+ 8
- 0
Marlin/src/config/examples/MakerParts/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Malyan/M200/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/TheBorg/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h Прегледај датотеку

@@ -453,6 +453,14 @@
453 453
   //#define JUNCTION_DEVIATION_INCLUDE_E
454 454
 #endif
455 455
 
456
+/**
457
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
458
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
459
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
460
+ * lowest stepping frequencies.
461
+ */
462
+//#define ADAPTIVE_STEP_SMOOTHING
463
+
456 464
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
457 465
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
458 466
 

+ 8
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h Прегледај датотеку

@@ -457,6 +457,14 @@
457 457
   //#define JUNCTION_DEVIATION_INCLUDE_E
458 458
 #endif
459 459
 
460
+/**
461
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
462
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
463
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
464
+ * lowest stepping frequencies.
465
+ */
466
+//#define ADAPTIVE_STEP_SMOOTHING
467
+
460 468
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
461 469
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
462 470
 

+ 8
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h Прегледај датотеку

@@ -452,6 +452,14 @@
452 452
   //#define JUNCTION_DEVIATION_INCLUDE_E
453 453
 #endif
454 454
 
455
+/**
456
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
457
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
458
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
459
+ * lowest stepping frequencies.
460
+ */
461
+//#define ADAPTIVE_STEP_SMOOTHING
462
+
455 463
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
456 464
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
457 465
 

+ 8
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 8
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h Прегледај датотеку

@@ -450,6 +450,14 @@
450 450
   //#define JUNCTION_DEVIATION_INCLUDE_E
451 451
 #endif
452 452
 
453
+/**
454
+ * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
455
+ * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
456
+ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
457
+ * lowest stepping frequencies.
458
+ */
459
+//#define ADAPTIVE_STEP_SMOOTHING
460
+
453 461
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
454 462
 #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16]
455 463
 

+ 128
- 42
Marlin/src/inc/Conditionals_post.h Прегледај датотеку

@@ -215,22 +215,6 @@
215 215
   #define DEFAULT_KEEPALIVE_INTERVAL 2
216 216
 #endif
217 217
 
218
-#ifdef CPU_32_BIT
219
-  /**
220
-   * Hidden options for developer
221
-   */
222
-  // Double stepping starts at STEP_DOUBLER_FREQUENCY + 1, quad stepping starts at STEP_DOUBLER_FREQUENCY * 2 + 1
223
-  #ifndef STEP_DOUBLER_FREQUENCY
224
-    #if ENABLED(LIN_ADVANCE)
225
-      #define STEP_DOUBLER_FREQUENCY 60000 // Hz
226
-    #else
227
-      #define STEP_DOUBLER_FREQUENCY 80000 // Hz
228
-    #endif
229
-  #endif
230
-  // Disable double / quad stepping
231
-  //#define DISABLE_MULTI_STEPPING
232
-#endif
233
-
234 218
 /**
235 219
  * Provide a MAX_AUTORETRACT for older configs
236 220
  */
@@ -238,23 +222,6 @@
238 222
   #define MAX_AUTORETRACT 99
239 223
 #endif
240 224
 
241
-/**
242
- * MAX_STEP_FREQUENCY differs for TOSHIBA
243
- */
244
-#if ENABLED(CONFIG_STEPPERS_TOSHIBA)
245
-  #ifdef CPU_32_BIT
246
-    #define MAX_STEP_FREQUENCY STEP_DOUBLER_FREQUENCY // Max step frequency for Toshiba Stepper Controllers, 96kHz is close to maximum for an Arduino Due
247
-  #else
248
-    #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
249
-  #endif
250
-#else
251
-  #ifdef CPU_32_BIT
252
-    #define MAX_STEP_FREQUENCY (STEP_DOUBLER_FREQUENCY * 4) // Max step frequency for the Due is approx. 330kHz
253
-  #else
254
-    #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
255
-  #endif
256
-#endif
257
-
258 225
 // MS1 MS2 Stepper Driver Microstepping mode table
259 226
 #define MICROSTEP1 LOW,LOW
260 227
 #if ENABLED(HEROIC_STEPPER_DRIVERS)
@@ -1346,15 +1313,6 @@
1346 1313
   #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT
1347 1314
 #endif
1348 1315
 
1349
-// Stepper pulse duration, in cycles
1350
-#define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND)
1351
-#ifdef CPU_32_BIT
1352
-  // Add additional delay for between direction signal and pulse signal of stepper
1353
-  #ifndef STEPPER_DIRECTION_DELAY
1354
-    #define STEPPER_DIRECTION_DELAY 0 // time in microseconds
1355
-  #endif
1356
-#endif
1357
-
1358 1316
 #ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation
1359 1317
   #undef UI_VOLTAGE_LEVEL
1360 1318
   #undef RADDS_DISPLAY
@@ -1486,4 +1444,132 @@
1486 1444
   #define USE_EXECUTE_COMMANDS_IMMEDIATE
1487 1445
 #endif
1488 1446
 
1447
+//
1448
+// Estimate the amount of time the ISR will take to execute
1449
+//
1450
+#ifdef CPU_32_BIT
1451
+
1452
+  // The base ISR takes 792 cycles
1453
+  #define ISR_BASE_CYCLES  792UL
1454
+
1455
+  // Linear advance base time is 64 cycles
1456
+  #if ENABLED(LIN_ADVANCE)
1457
+    #define ISR_LA_BASE_CYCLES 64UL
1458
+  #else
1459
+    #define ISR_LA_BASE_CYCLES 0UL
1460
+  #endif
1461
+
1462
+  // S curve interpolation adds 40 cycles
1463
+  #if ENABLED(S_CURVE_ACCELERATION)
1464
+    #define ISR_S_CURVE_CYCLES 40UL
1465
+  #else
1466
+    #define ISR_S_CURVE_CYCLES 0UL
1467
+  #endif
1468
+
1469
+  // Stepper Loop base cycles
1470
+  #define ISR_LOOP_BASE_CYCLES 4UL
1471
+
1472
+  // And each stepper takes 16 cycles
1473
+  #define ISR_STEPPER_CYCLES 16UL
1474
+
1475
+#else
1476
+
1477
+  // The base ISR takes 752 cycles
1478
+  #define ISR_BASE_CYCLES  752UL
1479
+
1480
+  // Linear advance base time is 32 cycles
1481
+  #if ENABLED(LIN_ADVANCE)
1482
+    #define ISR_LA_BASE_CYCLES 32UL
1483
+  #else
1484
+    #define ISR_LA_BASE_CYCLES 0UL
1485
+  #endif
1486
+
1487
+  // S curve interpolation adds 160 cycles
1488
+  #if ENABLED(S_CURVE_ACCELERATION)
1489
+    #define ISR_S_CURVE_CYCLES 160UL
1490
+  #else
1491
+    #define ISR_S_CURVE_CYCLES 0UL
1492
+  #endif
1493
+
1494
+  // Stepper Loop base cycles
1495
+  #define ISR_LOOP_BASE_CYCLES 32UL
1496
+
1497
+  // And each stepper takes 88 cycles
1498
+  #define ISR_STEPPER_CYCLES 88UL
1499
+
1500
+#endif
1501
+
1502
+// For each stepper, we add its time
1503
+#ifdef HAS_X_STEP
1504
+  #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES
1505
+#else
1506
+  #define ISR_X_STEPPER_CYCLES 0UL
1507
+#endif
1508
+
1509
+// For each stepper, we add its time
1510
+#ifdef HAS_Y_STEP
1511
+  #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES
1512
+#else
1513
+  #define ISR_Y_STEPPER_CYCLES 0UL
1514
+#endif
1515
+
1516
+// For each stepper, we add its time
1517
+#ifdef HAS_Z_STEP
1518
+  #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES
1519
+#else
1520
+  #define ISR_Z_STEPPER_CYCLES 0UL
1521
+#endif
1522
+
1523
+// E is always interpolated, even for mixing extruders
1524
+#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES
1525
+
1526
+// If linear advance is disabled, then the loop also handles them
1527
+#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER)
1528
+  #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * ISR_STEPPER_CYCLES)
1529
+#else
1530
+  #define ISR_MIXING_STEPPER_CYCLES  0UL
1531
+#endif
1532
+
1533
+// And the total minimum loop time is, without including the base
1534
+#define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES)
1535
+
1536
+// But the user could be enforcing a minimum time, so the loop time is
1537
+#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + ((MINIMUM_STEPPER_PULSE*2UL) > MIN_ISR_LOOP_CYCLES ? (MINIMUM_STEPPER_PULSE*2UL) : MIN_ISR_LOOP_CYCLES))
1538
+
1539
+// If linear advance is enabled, then it is handled separately
1540
+#if ENABLED(LIN_ADVANCE)
1541
+
1542
+  // Estimate the minimum LA loop time
1543
+  #if ENABLED(MIXING_EXTRUDER)
1544
+    #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES))
1545
+  #else
1546
+    #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES
1547
+  #endif
1548
+
1549
+  // And the real loop time
1550
+  #define ISR_LA_LOOP_CYCLES ((MINIMUM_STEPPER_PULSE*2UL) > MIN_ISR_LA_LOOP_CYCLES ? (MINIMUM_STEPPER_PULSE*2UL) : MIN_ISR_LA_LOOP_CYCLES)
1551
+
1552
+#else
1553
+  #define ISR_LA_LOOP_CYCLES 0UL
1554
+#endif
1555
+
1556
+// Now estimate the total ISR execution time in cycles given a step per ISR multiplier
1557
+#define ISR_EXECUTION_CYCLES(rate) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES * rate) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / rate)
1558
+
1559
+// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz)
1560
+#define MAX_128X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(128))
1561
+#define MAX_64X_STEP_ISR_FREQUENCY  (F_CPU / ISR_EXECUTION_CYCLES(64))
1562
+#define MAX_32X_STEP_ISR_FREQUENCY  (F_CPU / ISR_EXECUTION_CYCLES(32))
1563
+#define MAX_16X_STEP_ISR_FREQUENCY  (F_CPU / ISR_EXECUTION_CYCLES(16))
1564
+#define MAX_8X_STEP_ISR_FREQUENCY   (F_CPU / ISR_EXECUTION_CYCLES(8))
1565
+#define MAX_4X_STEP_ISR_FREQUENCY   (F_CPU / ISR_EXECUTION_CYCLES(4))
1566
+#define MAX_2X_STEP_ISR_FREQUENCY   (F_CPU / ISR_EXECUTION_CYCLES(2))
1567
+#define MAX_1X_STEP_ISR_FREQUENCY   (F_CPU / ISR_EXECUTION_CYCLES(1))
1568
+
1569
+// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz)
1570
+#define MIN_STEP_ISR_FREQUENCY    MAX_1X_STEP_ISR_FREQUENCY
1571
+
1572
+// Disable multiple steps per ISR
1573
+//#define DISABLE_MULTI_STEPPING
1574
+
1489 1575
 #endif // CONDITIONALS_POST_H

+ 10
- 4
Marlin/src/module/planner.cpp Прегледај датотеку

@@ -679,9 +679,9 @@ void Planner::init() {
679 679
       return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16);
680 680
     }
681 681
   #else
682
-    // All the other 32 CPUs can easily perform the inverse using hardware division,
682
+    // All other 32-bit MPUs can easily do inverse using hardware division,
683 683
     // so we don't need to reduce precision or to use assembly language at all.
684
-    // This routine, for all the other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d
684
+    // This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d
685 685
     static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { return 0xFFFFFFFF / d; }
686 686
   #endif
687 687
 #endif
@@ -1646,10 +1646,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1646 1646
   // Bail if this is a zero-length block
1647 1647
   if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false;
1648 1648
 
1649
-  // For a mixing extruder, get a magnified step_event_count for each
1649
+  // For a mixing extruder, get a magnified esteps for each
1650 1650
   #if ENABLED(MIXING_EXTRUDER)
1651 1651
     for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
1652
-      block->mix_event_count[i] = mixing_factor[i] * block->step_event_count;
1652
+      block->mix_steps[i] = mixing_factor[i] * (
1653
+        #if ENABLED(LIN_ADVANCE)
1654
+          esteps
1655
+        #else
1656
+          block->step_event_count
1657
+        #endif
1658
+      );
1653 1659
   #endif
1654 1660
 
1655 1661
   #if FAN_COUNT > 0

+ 2
- 2
Marlin/src/module/planner.h Прегледај датотеку

@@ -108,7 +108,7 @@ typedef struct {
108 108
   uint8_t active_extruder;                  // The extruder to move (if E move)
109 109
 
110 110
   #if ENABLED(MIXING_EXTRUDER)
111
-    uint32_t mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers
111
+    uint32_t mix_steps[MIXING_STEPPERS];    // Scaled steps[E_AXIS] for the mixing steppers
112 112
   #endif
113 113
 
114 114
   // Settings for the trapezoid generator
@@ -130,7 +130,7 @@ typedef struct {
130 130
   // Advance extrusion
131 131
   #if ENABLED(LIN_ADVANCE)
132 132
     bool use_advance_lead;
133
-    uint16_t advance_speed,                 // Timer value for extruder speed offset
133
+    uint16_t advance_speed,                 // STEP timer value for extruder speed offset ISR
134 134
              max_adv_steps,                 // max. advance steps to get cruising speed pressure (not always nominal_speed!)
135 135
              final_adv_steps;               // advance steps due to exit speed
136 136
     float e_D_ratio;

+ 396
- 381
Marlin/src/module/stepper.cpp
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 75
- 56
Marlin/src/module/stepper.h Прегледај датотеку

@@ -76,10 +76,14 @@ class Stepper {
76 76
   private:
77 77
 
78 78
     static uint8_t last_direction_bits,     // The next stepping-bits to be output
79
-                   last_movement_extruder,  // Last movement extruder, as computed when the last movement was fetched from planner
80 79
                    axis_did_move;           // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
80
+
81 81
     static bool abort_current_block;        // Signals to the stepper that current block should be aborted
82 82
 
83
+    #if DISABLED(MIXING_EXTRUDER)
84
+      static uint8_t last_moved_extruder;   // Last-moved extruder, as set when the last movement was fetched from planner
85
+    #endif
86
+
83 87
     #if ENABLED(X_DUAL_ENDSTOPS)
84 88
       static bool locked_X_motor, locked_X2_motor;
85 89
     #endif
@@ -90,9 +94,34 @@ class Stepper {
90 94
       static bool locked_Z_motor, locked_Z2_motor;
91 95
     #endif
92 96
 
93
-    // Counter variables for the Bresenham line tracer
94
-    static int32_t counter_X, counter_Y, counter_Z, counter_E;
95
-    static uint32_t step_events_completed; // The number of step events executed in the current block
97
+    static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks
98
+    static uint8_t steps_per_isr;         // Count of steps to perform per Stepper ISR call
99
+
100
+    #if ENABLED(ADAPTIVE_STEP_SMOOTHING)
101
+      static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis
102
+    #else
103
+      static constexpr uint8_t oversampling_factor = 0;
104
+    #endif
105
+
106
+    // Delta error variables for the Bresenham line tracer
107
+    static int32_t delta_error[XYZE];
108
+    static uint32_t advance_dividend[XYZE],
109
+                    advance_divisor,
110
+                    step_events_completed,  // The number of step events executed in the current block
111
+                    accelerate_until,       // The point from where we need to stop acceleration
112
+                    decelerate_after,       // The point from where we need to start decelerating
113
+                    step_event_count;       // The total event count for the current block
114
+
115
+    // Mixing extruder mix delta_errors for bresenham tracing
116
+    #if ENABLED(MIXING_EXTRUDER)
117
+      static int32_t delta_error_m[MIXING_STEPPERS];
118
+      static uint32_t advance_dividend_m[MIXING_STEPPERS],
119
+                      advance_divisor_m;
120
+      #define MIXING_STEPPERS_LOOP(VAR) \
121
+        for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++)
122
+    #else
123
+      static int8_t active_extruder;      // Active extruder
124
+    #endif
96 125
 
97 126
     #if ENABLED(S_CURVE_ACCELERATION)
98 127
       static int32_t bezier_A,     // A coefficient in Bézier speed curve
@@ -107,33 +136,19 @@ class Stepper {
107 136
     #endif
108 137
 
109 138
     static uint32_t nextMainISR;   // time remaining for the next Step ISR
110
-    static bool all_steps_done;    // all steps done
111
-
112 139
     #if ENABLED(LIN_ADVANCE)
113
-
114
-      static uint32_t LA_decelerate_after; // Copy from current executed block. Needed because current_block is set to NULL "too early".
115
-      static uint32_t nextAdvanceISR, eISR_Rate;
116
-      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".
117
-      static int8_t e_steps;
118
-      static bool use_advance_lead;
119
-      #if E_STEPPERS > 1
120
-        static int8_t LA_active_extruder; // Copy from current executed block. Needed because current_block is set to NULL "too early".
121
-      #else
122
-        static constexpr int8_t LA_active_extruder = 0;
123
-      #endif
124
-
140
+      static uint32_t nextAdvanceISR, LA_isr_rate;
141
+      static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early".
142
+      static int8_t LA_steps;
143
+      static bool LA_use_advance_lead;
125 144
     #endif // LIN_ADVANCE
126 145
 
127
-    static uint32_t acceleration_time, deceleration_time;
128
-    static uint8_t step_loops, step_loops_nominal;
129
-
130
-    static uint32_t ticks_nominal;
146
+    static int32_t ticks_nominal;
131 147
     #if DISABLED(S_CURVE_ACCELERATION)
132 148
       static uint32_t acc_step_rate; // needed for deceleration start point
133 149
     #endif
134 150
 
135 151
     static volatile int32_t endstops_trigsteps[XYZ];
136
-    static volatile int32_t endstops_stepsTotal, endstops_stepsDone;
137 152
 
138 153
     //
139 154
     // Positions of stepper motors, in step units
@@ -145,16 +160,6 @@ class Stepper {
145 160
     //
146 161
     static int8_t count_direction[NUM_AXIS];
147 162
 
148
-    //
149
-    // Mixing extruder mix counters
150
-    //
151
-    #if ENABLED(MIXING_EXTRUDER)
152
-      static int32_t counter_m[MIXING_STEPPERS];
153
-      #define MIXING_STEPPERS_LOOP(VAR) \
154
-        for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) \
155
-          if (current_block->mix_event_count[VAR])
156
-    #endif
157
-
158 163
   public:
159 164
 
160 165
     //
@@ -201,7 +206,15 @@ class Stepper {
201 206
     FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); }
202 207
 
203 208
     // The extruder associated to the last movement
204
-    FORCE_INLINE static uint8_t movement_extruder() { return last_movement_extruder; }
209
+    FORCE_INLINE static uint8_t movement_extruder() {
210
+      return
211
+        #if ENABLED(MIXING_EXTRUDER)
212
+          0
213
+        #else
214
+          last_moved_extruder
215
+        #endif
216
+      ;
217
+    }
205 218
 
206 219
     // Handle a triggered endstop
207 220
     static void endstop_triggered(const AxisEnum axis);
@@ -279,34 +292,42 @@ class Stepper {
279 292
     // Set direction bits for all steppers
280 293
     static void set_directions();
281 294
 
282
-    // Limit the speed to 10KHz for AVR
283
-    #ifndef STEP_DOUBLER_FREQUENCY
284
-      #define STEP_DOUBLER_FREQUENCY 10000
285
-    #endif
286
-
287
-    FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate) {
295
+    FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) {
288 296
       uint32_t timer;
289 297
 
290
-      NOMORE(step_rate, uint32_t(MAX_STEP_FREQUENCY));
298
+      // Scale the frequency, as requested by the caller
299
+      step_rate <<= scale;
291 300
 
301
+      uint8_t multistep = 1;
292 302
       #if DISABLED(DISABLE_MULTI_STEPPING)
293
-        if (step_rate > STEP_DOUBLER_FREQUENCY * 2) { // If steprate > (STEP_DOUBLER_FREQUENCY * 2) kHz >> step 4 times
294
-          step_rate >>= 2;
295
-          step_loops = 4;
296
-        }
297
-        else if (step_rate > STEP_DOUBLER_FREQUENCY) { // If steprate > STEP_DOUBLER_FREQUENCY kHz >> step 2 times
303
+
304
+        // The stepping frequency limits for each multistepping rate
305
+        static const uint32_t limit[] PROGMEM = {
306
+          (  MAX_1X_STEP_ISR_FREQUENCY     ),
307
+          (  MAX_2X_STEP_ISR_FREQUENCY >> 1),
308
+          (  MAX_4X_STEP_ISR_FREQUENCY >> 2),
309
+          (  MAX_8X_STEP_ISR_FREQUENCY >> 3),
310
+          ( MAX_16X_STEP_ISR_FREQUENCY >> 4),
311
+          ( MAX_32X_STEP_ISR_FREQUENCY >> 5),
312
+          ( MAX_64X_STEP_ISR_FREQUENCY >> 6),
313
+          (MAX_128X_STEP_ISR_FREQUENCY >> 7)
314
+        };
315
+
316
+        // Select the proper multistepping
317
+        uint8_t idx = 0;
318
+        while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) {
298 319
           step_rate >>= 1;
299
-          step_loops = 2;
300
-        }
301
-        else
320
+          multistep <<= 1;
321
+          ++idx;
322
+        };
323
+      #else
324
+        NOMORE(step_rate, uint32_t(MAX_1X_STEP_ISR_FREQUENCY));
302 325
       #endif
303
-          step_loops = 1;
326
+      *loops = multistep;
304 327
 
305 328
       #ifdef CPU_32_BIT
306 329
         // In case of high-performance processor, it is able to calculate in real-time
307
-        const uint32_t min_time_per_step = (HAL_STEPPER_TIMER_RATE) / ((STEP_DOUBLER_FREQUENCY) * 2);
308 330
         timer = uint32_t(HAL_STEPPER_TIMER_RATE) / step_rate;
309
-        NOLESS(timer, min_time_per_step); // (STEP_DOUBLER_FREQUENCY * 2 kHz - this should never happen)
310 331
       #else
311 332
         constexpr uint32_t min_step_rate = F_CPU / 500000U;
312 333
         NOLESS(step_rate, min_step_rate);
@@ -324,10 +345,8 @@ class Stepper {
324 345
           timer = (uint16_t)pgm_read_word_near(table_address)
325 346
                 - (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3);
326 347
         }
327
-        if (timer < 100) { // (20kHz - this should never happen)
328
-          timer = 100;
329
-          SERIAL_ECHOLNPAIR(MSG_STEPPER_TOO_HIGH, step_rate);
330
-        }
348
+        // (there is no need to limit the timer value here. All limits have been
349
+        // applied above, and AVR is able to keep up at 30khz Stepping ISR rate)
331 350
       #endif
332 351
 
333 352
       return timer;

+ 269
- 0
docs/Bresenham.md Прегледај датотеку

@@ -0,0 +1,269 @@
1
+On the Bresenham algorithm as implemented by Marlin:
2
+(Taken from (https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html)
3
+
4
+The basic Bresenham algorithm:
5
+
6
+Consider drawing a line on a raster grid where we restrict the allowable slopes of the line to the range 0 <= m <= 1
7
+
8
+If we further restrict the line-drawing routine so that it always increments x as it plots, it becomes clear that, having plotted a point at (x,y), the routine has a severely limited range of options as to where it may put the next point on the line:
9
+
10
+- It may plot the point (x+1,y), or:
11
+- It may plot the point (x+1,y+1).
12
+
13
+So, working in the first positive octant of the plane, line drawing becomes a matter of deciding between two possibilities at each step.
14
+
15
+We can draw a diagram of the situation which the plotting program finds itself in having plotted (x,y).
16
+
17
+```
18
+  y+1 +--------------*
19
+      |             /
20
+      |            /
21
+      |           /
22
+      |          /
23
+      |    y+e+m*--------+-
24
+      |        /| ^    |
25
+      |       / | |m   |
26
+      |      /  | |    |
27
+      |     /   | v    |
28
+      | y+e*----|-----   |m+ε
29
+      |   /|    | ^    |
30
+      |  / |    | |ε   |
31
+      | /  |    | |    |
32
+      |/   |    | v    v
33
+    y *----+----+----------+--
34
+           x   x+1
35
+```
36
+
37
+In plotting (x,y) the line drawing routine will, in general, be making a compromise between what it would like to draw and what the resolution of the stepper motors actually allows it to draw. Usually the plotted point (x,y) will be in error, the actual, mathematical point on the line will not be addressable on the pixel grid. So we associate an error, ε, with each y ordinate, the real value of y should be y+ε . This error will range from -0.5 to just under +0.5.
38
+
39
+In moving from x to x+1 we increase the value of the true (mathematical) y-ordinate by an amount equal to the slope of the line, m. We will choose to plot (x+1,y) if the difference between this new value and y is less than 0.5
40
+
41
+```
42
+y + ε + m < y + 0.5
43
+```
44
+
45
+Otherwise we will plot (x+1,y+1). It should be clear that by so doing we minimize the total error between the mathematical line segment and what actually gets drawn on the display.
46
+
47
+The error resulting from this new point can now be written back into ε, this will allow us to repeat the whole process for the next point along the line, at x+2.
48
+
49
+The new value of error can adopt one of two possible values, depending on what new point is plotted. If (x+1,y) is chosen, the new value of error is given by:
50
+
51
+```
52
+ε[new] = (y + ε + m) - y
53
+```
54
+
55
+Otherwise, it is:
56
+
57
+```
58
+ε[new] = (y + ε + m) - (y + 1)
59
+```
60
+
61
+This gives an algorithm for a DDA which avoids rounding operations, instead using the error variable ε to control plotting:
62
+
63
+```
64
+  ε = 0, y = y[1]
65
+  for x = x1 to x2 do
66
+    Plot point at (x,y)
67
+    if (ε + m < 0.5)
68
+      ε = ε + m
69
+    else
70
+      y = y + 1, ε = ε + m - 1
71
+    endif
72
+  endfor
73
+```
74
+
75
+This still employs floating point values. Consider, however, what happens if we multiply across both sides of the plotting test by Δx and then by 2:
76
+
77
+```
78
+        ε + m < 0.5
79
+    ε + Δy/Δx < 0.5
80
+2.ε.Δx + 2.Δy < Δx
81
+```
82
+
83
+All quantities in this inequality are now integral.
84
+
85
+Substitute ε' for ε.Δx . The test becomes:
86
+
87
+```
88
+2.(ε' + Δy) < Δx
89
+```
90
+
91
+This gives an integer-only test for deciding which point to plot.
92
+
93
+The update rules for the error on each step may also be cast into ε' form. Consider the floating-point versions of the update rules:
94
+
95
+```
96
+ε = ε + m
97
+ε = ε + m - 1
98
+```
99
+
100
+ Multiplying through by Δx yields:
101
+
102
+```
103
+ε.Δx = ε.Δx + Δy
104
+ε.Δx = ε.Δx + Δy - Δx
105
+```
106
+
107
+Which is in ε' form:
108
+
109
+```
110
+ε' = ε' + Δy
111
+ε' = ε' + Δy - Δx
112
+```
113
+
114
+Using this new ``error'' value, ε'  with the new test and update equations gives Bresenham's integer-only line drawing algorithm:
115
+
116
+```
117
+ε' = 0, y = y[1]
118
+for x = x1 to x2 do
119
+  Plot point at (x,y)
120
+  if (2.(ε' + Δy) < Δx)
121
+    ε' = ε' + Δy
122
+  else
123
+    y = y + 1, ε' = ε' + Δy - Δx
124
+  endif
125
+endfor
126
+```
127
+
128
+It is a Integer only algorithm - hence efficient (fast). And the Multiplication by 2 can be implemented by left-shift.  0 <= m <= 1
129
+
130
+### Oversampling Bresenham algorithm:
131
+
132
+Even if Bresenham does NOT lose steps at all, and also does NOT accumulate error, there is a concept i would call "time resolution" - If the quotient between major axis and minor axis (major axis means, in this context, the axis that must create more step pulses compared with the other ones, including the extruder)
133
+
134
+Well, if the quotient result is not an integer, then Bresenham, at some points in the movement of the major axis, must decide that it has to move the minor axis. It is done in such way that after the full major axis movement has executed, it also has executed the full movements of the minor axis. And the minor axis steps were properly distributed evenly along the major axis movement. So good so far.
135
+
136
+But, as said, Bresenham has "discrete" decision points: It can only decide to move (or not to move) minor axis exactly at the moment the major axis moves. And that is not the ideal point (in time) usually.
137
+
138
+With slow movements that are composed of a similar, but not equal number of steps in all axes, the problem worsens, as the decision points are distributed very sparsely, and there are large delays between those decision points.
139
+
140
+It is nearly trivial to extend Bresenham to "oversample" in that situation: Let's do it:
141
+
142
+Assume that we want to use Bresenham to calculate when to step (move in Y direction), but we want to do it, not for integer increments of the X axis, rather than, for fractional increments.
143
+
144
+Let's call 'r' the count of subdivisions we want to split an integer increment of the X axis:
145
+
146
+```
147
+m = Δy/Δx = increment of y due to the increment of x1
148
+```
149
+
150
+Every time we move `1/r` in the X axis, then the Y axis should move `m.1/r`
151
+
152
+But, as stated previously, due to the resolution of the screen, there are 2 choices:
153
+
154
+- It may plot the point `(x+(1/r),y)`, or:
155
+- It may plot the point `(x+(1/r),y+1)`.
156
+
157
+That decision must be made keeping the error as small as possible:
158
+
159
+```
160
+-0.5 < ε < 0.5
161
+```
162
+
163
+So, the proper condition for that decision is (`m/r` is the increment of y due to the fractional `1/r` increment of `x`):
164
+
165
+```
166
+y + ε + m/r < y + 0.5
167
+ε + m/r < 0.5                                   [1]
168
+```
169
+
170
+Once we did the decision, then the error update conditions are:
171
+
172
+Decision A:
173
+```
174
+ε[new] = y + ε + m/r - y
175
+ε[new] = ε + m/r                                [2]
176
+```
177
+
178
+Decision B:
179
+```
180
+ε[new] = y + ε + m/r - (y+1)
181
+ε[new] = ε + m/r - 1                            [3]
182
+```
183
+
184
+We replace m in the decision inequality [1] by its definition:
185
+
186
+```
187
+ε + m/r < 0.5
188
+ε + ΔY/(ΔX*r) < 0.5
189
+```
190
+
191
+Then, we multiply it by `2.Δx.r`:
192
+
193
+```
194
+ε + ΔY/(ΔX*r) < 0.5
195
+2.ΔX.ε.r + 2.ΔY < ΔX.r
196
+```
197
+
198
+If we define `ε' = 2.ε.ΔX.r` then it becomes:
199
+
200
+```
201
+ε' + 2.ΔY < ΔX.r                                [4]
202
+```
203
+
204
+Now, for the update rules, we multiply by 2.r.ΔX
205
+
206
+```
207
+ε[new] = ε + m/r
208
+2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.r.ΔX.ΔY/ΔX/r
209
+2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.ΔY
210
+ε'[new] = ε' + 2.ΔY                             [6]
211
+```
212
+
213
+```
214
+ε[new] = ε + m/r - 1
215
+2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.r.ΔX.ΔY/ΔX/r - 1 . 2.r.ΔX
216
+2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.ΔY - 2.ΔX.r
217
+ε'[new] = ε' + 2.ΔY - 2.ΔX.r                    [7]
218
+```
219
+
220
+All expressions, the decision inequality [4], and the update equations [5] and [6] are integer valued. There is no need for floating point arithmetic at all.
221
+
222
+Summarizing:
223
+
224
+```
225
+Condition equation:
226
+
227
+  ε' + 2.ΔY < ΔX.r                              [4]
228
+
229
+Error update equations:
230
+
231
+  ε'[new] = ε' + 2.ΔY                           [6]
232
+
233
+  ε'[new] = ε' + 2.ΔY - 2.ΔX.r                  [7]
234
+```
235
+
236
+This can be implemented in C as:
237
+
238
+```cpp
239
+  class OversampledBresenham {
240
+    private:
241
+      long divisor, // stepsX
242
+           dividend, // stepsY
243
+           advanceDivisor, // advanceX
244
+           advanceDividend; // advanceY
245
+      int errorAccumulator; // Error accumulator
246
+
247
+    public:
248
+      unsigned int ticker;
249
+
250
+      OversampledBresenhan(const long& inDividend, const long& inDivisor, int rate) {
251
+        ticker = 0;
252
+        divisor = inDivisor;
253
+        dividend = inDividend;
254
+        advanceDivisor = divisor * 2 * rate;
255
+        advanceDividend = dividend * 2;
256
+        errorAccumulator = -divisor * rate;
257
+      }
258
+
259
+      bool tick() {
260
+        errorAccumulator += advanceDividend;
261
+        const bool over = errorAccumulator >= 0;
262
+        if (over) {
263
+          ticker++;
264
+          errorAccumulator -= advanceDivisor;
265
+        }
266
+        return over;
267
+      }
268
+  };
269
+```

Loading…
Откажи
Сачувај