From 03f4891fb98c032509643b6fbc8b6d24df6630b6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 Oct 2017 04:25:18 -0500 Subject: [PATCH] Remove legacy ADVANCE feature --- Marlin/Configuration_adv.h | 14 -- Marlin/src/config/default/Configuration_adv.h | 14 -- .../AlephObjects/TAZ4/Configuration_adv.h | 14 -- .../examples/Anet/A6/Configuration_adv.h | 14 -- .../examples/Anet/A8/Configuration_adv.h | 14 -- .../examples/BQ/Hephestos/Configuration_adv.h | 14 -- .../BQ/Hephestos_2/Configuration_adv.h | 14 -- .../examples/BQ/WITBOX/Configuration_adv.h | 14 -- .../examples/Cartesio/Configuration_adv.h | 14 -- .../Creality/CR-10/Configuration_adv.h | 14 -- .../config/examples/Felix/Configuration_adv.h | 14 -- .../Folger Tech/i3-2020/Configuration_adv.h | 14 -- .../Infitary/i3-M508/Configuration_adv.h | 14 -- .../examples/Malyan/M150/Configuration_adv.h | 14 -- .../examples/RigidBot/Configuration_adv.h | 14 -- .../config/examples/SCARA/Configuration_adv.h | 14 -- .../examples/Sanguinololu/Configuration_adv.h | 14 -- .../examples/TinyBoy2/Configuration_adv.h | 14 -- .../Velleman/K8200/Configuration_adv.h | 14 -- .../Velleman/K8400/Configuration_adv.h | 14 -- .../FLSUN/auto_calibrate/Configuration_adv.h | 14 -- .../FLSUN/kossel_mini/Configuration_adv.h | 14 -- .../delta/generic/Configuration_adv.h | 14 -- .../delta/kossel_mini/Configuration_adv.h | 14 -- .../delta/kossel_pro/Configuration_adv.h | 14 -- .../delta/kossel_xl/Configuration_adv.h | 14 -- .../gCreate/gMax1.5+/Configuration_adv.h | 14 -- .../examples/makibox/Configuration_adv.h | 14 -- .../tvrrug/Round2/Configuration_adv.h | 14 -- .../config/examples/wt150/Configuration_adv.h | 14 -- Marlin/src/inc/Conditionals_post.h | 9 +- Marlin/src/inc/SanityCheck.h | 9 +- Marlin/src/module/planner.cpp | 26 +-- Marlin/src/module/planner.h | 5 - Marlin/src/module/stepper.cpp | 150 ++++-------------- Marlin/src/module/stepper.h | 44 ++--- 36 files changed, 46 insertions(+), 617 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 402c5b18cf..f3b5f1b4fa 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 402c5b18cf..f3b5f1b4fa 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index a87e55d9d7..6cef78d3df 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 26f0cecf15..bdc7c40637 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 195c520745..a15c653572 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 14959bbfb2..fb0233a759 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 1.75 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index 82f0175d26..a8121ff10d 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 14959bbfb2..fb0233a759 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 1.75 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index f3a226fadf..3e1a97535d 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 4294fbdf97..26048c73e7 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -614,20 +614,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index e6e8d741f3..77fc82b703 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h index 8f1fc71eee..555887068f 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index f0d026ad19..457abcea5f 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 7c53fc182d..043c023729 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index f687e25ed0..b2011b9385 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 1.75 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 42ffe17a68..21533a1b6c 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 1.75 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index b8df16589b..b471642165 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -610,20 +610,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 85afa6ed92..d8f7861afb 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index bc03354b34..0cf327d23b 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -634,20 +634,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 0f46a008d4..003c0665c5 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 0c837ada3f..9889d51dd9 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -623,20 +623,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 88f8444eb2..2524686653 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -623,20 +623,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index 88f8444eb2..2524686653 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -623,20 +623,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index 88f8444eb2..2524686653 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -623,20 +623,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index 142d59ba61..63aa8ffbb4 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -628,20 +628,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index 8b7c98341e..19a2caf65d 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -623,20 +623,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 7990eb3812..b693866d3b 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index ca090dda47..617dcc97a1 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 853fc54454..c916366346 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 8d1ee372c5..103b825efd 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -621,20 +621,6 @@ // @section extruder -// extruder advance constant (s2/mm3) -// -// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 -// -// Hooke's law says: force = k * distance -// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant -// so: v ^ 2 is proportional to number of steps we advance the extruder -//#define ADVANCE - -#if ENABLED(ADVANCE) - #define EXTRUDER_ADVANCE_K .0 - #define D_FILAMENT 2.85 -#endif - /** * Implementation of linear pressure control * diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index c86a665b09..0417a8b657 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -209,7 +209,7 @@ */ // Double stepping starts at STEP_DOUBLER_FREQUENCY + 1, quad stepping starts at STEP_DOUBLER_FREQUENCY * 2 + 1 #ifndef STEP_DOUBLER_FREQUENCY - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + #if ENABLED(LIN_ADVANCE) #define STEP_DOUBLER_FREQUENCY 60000 // Hz #else #define STEP_DOUBLER_FREQUENCY 80000 // Hz @@ -260,13 +260,8 @@ #endif /** - * Advance calculated values + * Override here because this is set in Configuration_adv.h */ - #if ENABLED(ADVANCE) - #define EXTRUSION_AREA CIRCLE_CIRC(0.5 * D_FILAMENT) - #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS_N] / (EXTRUSION_AREA)) - #endif - #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) #undef SD_DETECT_INVERTED #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index d841d6cbf7..133f6dd77b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -208,6 +208,8 @@ #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." #elif defined(MIN_RETRACT) #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." +#elif defined(ADVANCE) + #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." #endif /** @@ -813,13 +815,6 @@ static_assert(1 >= 0 #endif #endif // DISABLE_[XYZ] -/** - * Advance Extrusion - */ -#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE) - #error "You can enable ADVANCE or LIN_ADVANCE, but not both." -#endif - /** * Filament Width Sensor */ diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 0373f342c0..37d9f6e132 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -228,10 +228,6 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e block->decelerate_after = accelerate_steps + plateau_steps; block->initial_rate = initial_rate; block->final_rate = final_rate; - #if ENABLED(ADVANCE) - block->initial_advance = block->advance * sq(entry_factor); - block->final_advance = block->advance * sq(exit_factor); - #endif } CRITICAL_SECTION_END; } @@ -1432,27 +1428,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const * axis_steps_per_mm[E_AXIS_N] * 256.0 ); - #elif ENABLED(ADVANCE) - - // Calculate advance rate - if (esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS])) { - const long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2); - const float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(current_speed[E_AXIS], EXTRUSION_AREA) * 256; - block->advance = advance; - block->advance_rate = acc_dist ? advance / (float)acc_dist : 0; - } - else - block->advance_rate = block->advance = 0; - - /** - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("advance :"); - SERIAL_ECHO(block->advance/256.0); - SERIAL_ECHOPGM("advance rate :"); - SERIAL_ECHOLN(block->advance_rate/256.0); - */ - - #endif // ADVANCE or LIN_ADVANCE + #endif // LIN_ADVANCE calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index def50dbb8e..85f35f35b8 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -100,11 +100,6 @@ typedef struct { #if ENABLED(LIN_ADVANCE) bool use_advance_lead; uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float - #elif ENABLED(ADVANCE) - int32_t advance_rate; - volatile int32_t initial_advance; - volatile int32_t final_advance; - float advance; #endif // Fields used by the motion planner to manage acceleration diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 1419b96109..a04e74fa84 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -108,7 +108,7 @@ long Stepper::counter_X = 0, volatile uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block -#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) +#if ENABLED(LIN_ADVANCE) constexpr HAL_TIMER_TYPE ADV_NEVER = HAL_TIMER_TYPE_MAX; @@ -116,18 +116,10 @@ volatile uint32_t Stepper::step_events_completed = 0; // The number of step even Stepper::nextAdvanceISR = ADV_NEVER, Stepper::eISR_Rate = ADV_NEVER; - #if ENABLED(LIN_ADVANCE) - volatile int Stepper::e_steps[E_STEPPERS]; - int Stepper::final_estep_rate, - Stepper::current_estep_rate[E_STEPPERS], - Stepper::current_adv_steps[E_STEPPERS]; - #else - long Stepper::e_steps[E_STEPPERS], - Stepper::final_advance = 0, - Stepper::old_advance = 0, - Stepper::advance_rate, - Stepper::advance; - #endif + volatile int Stepper::e_steps[E_STEPPERS]; + int Stepper::final_estep_rate, + Stepper::current_estep_rate[E_STEPPERS], + Stepper::current_adv_steps[E_STEPPERS]; /** * See https://github.com/MarlinFirmware/Marlin/issues/5699#issuecomment-309264382 @@ -144,7 +136,7 @@ volatile uint32_t Stepper::step_events_completed = 0; // The number of step even return ADV_NEVER; } -#endif // ADVANCE || LIN_ADVANCE +#endif // LIN_ADVANCE long Stepper::acceleration_time, Stepper::deceleration_time; @@ -277,7 +269,7 @@ void Stepper::set_directions() { SET_STEP_DIR(Z); // C #endif - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) if (motor_direction(E_AXIS)) { REV_E_DIR(); count_direction[E_AXIS] = -1; @@ -286,7 +278,7 @@ void Stepper::set_directions() { NORM_E_DIR(); count_direction[E_AXIS] = 1; } - #endif // !ADVANCE && !LIN_ADVANCE + #endif // !LIN_ADVANCE } #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) @@ -312,7 +304,7 @@ void Stepper::set_directions() { HAL_STEP_TIMER_ISR { HAL_timer_isr_prologue(STEP_TIMER_NUM); - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + #if ENABLED(LIN_ADVANCE) Stepper::advance_isr_scheduler(); #else Stepper::isr(); @@ -326,7 +318,7 @@ void Stepper::isr() { #define ENDSTOP_NOMINAL_OCR_VAL 1500 * HAL_TICKS_PER_US // check endstops every 1.5ms to guarantee two stepper ISRs within 5ms for BLTouch #define OCR_VAL_TOLERANCE 500 * HAL_TICKS_PER_US // First max delay is 2.0ms, last min delay is 0.5ms, all others 1.5ms - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars) DISABLE_TEMPERATURE_INTERRUPT(); // Temperature ISR DISABLE_STEPPER_DRIVER_INTERRUPT(); @@ -361,7 +353,7 @@ void Stepper::isr() { _NEXT_ISR(ocr_val); - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) #ifdef CPU_32_BIT HAL_timer_set_count(STEP_TIMER_NUM, ocr_val); #else @@ -416,10 +408,6 @@ void Stepper::isr() { return; } #endif - - // #if ENABLED(ADVANCE) - // e_steps[TOOL_E_INDEX] = 0; - // #endif } else { _NEXT_ISR(HAL_STEPPER_TIMER_RATE / 1000); // Run at slow speed - 1 KHz @@ -465,33 +453,7 @@ void Stepper::isr() { } #endif - #elif ENABLED(ADVANCE) - - // Always count the unified E axis - counter_E += current_block->steps[E_AXIS]; - if (counter_E > 0) { - counter_E -= current_block->step_event_count; - #if DISABLED(MIXING_EXTRUDER) - // Don't step E here for mixing extruder - motor_direction(E_AXIS) ? --e_steps[TOOL_E_INDEX] : ++e_steps[TOOL_E_INDEX]; - #endif - } - - #if ENABLED(MIXING_EXTRUDER) - - // Step mixing steppers proportionally - const bool dir = motor_direction(E_AXIS); - MIXING_STEPPERS_LOOP(j) { - counter_m[j] += current_block->steps[E_AXIS]; - if (counter_m[j] > 0) { - counter_m[j] -= current_block->mix_event_count[j]; - dir ? --e_steps[j] : ++e_steps[j]; - } - } - - #endif // MIXING_EXTRUDER - - #endif // ADVANCE or LIN_ADVANCE + #endif // LIN_ADVANCE #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP @@ -552,7 +514,7 @@ void Stepper::isr() { #else #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 #endif - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6 #else @@ -588,7 +550,7 @@ void Stepper::isr() { #endif // For non-advance use linear interpolation for E also - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) // Keep updating the single E axis counter_E += current_block->steps[E_AXIS]; @@ -602,7 +564,7 @@ void Stepper::isr() { #else // !MIXING_EXTRUDER PULSE_START(E); #endif - #endif // !ADVANCE && !LIN_ADVANCE + #endif // !LIN_ADVANCE // For minimum pulse time wait before stopping pulses #if EXTRA_CYCLES_XYZE > 20 @@ -622,7 +584,7 @@ void Stepper::isr() { PULSE_STOP(Z); #endif - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) // Always step the single E axis if (counter_E > 0) { @@ -638,7 +600,7 @@ void Stepper::isr() { #else // !MIXING_EXTRUDER PULSE_STOP(E); #endif - #endif // !ADVANCE && !LIN_ADVANCE + #endif // !LIN_ADVANCE if (++step_events_completed >= current_block->step_event_count) { all_steps_done = true; @@ -655,6 +617,7 @@ void Stepper::isr() { } // steps_loop #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead) { const int delta_adv_steps = current_estep_rate[TOOL_E_INDEX] - current_adv_steps[TOOL_E_INDEX]; current_adv_steps[TOOL_E_INDEX] += delta_adv_steps; @@ -666,13 +629,11 @@ void Stepper::isr() { // For most extruders, advance the single E stepper e_steps[TOOL_E_INDEX] += delta_adv_steps; #endif - } - #endif - - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + } // If we have esteps to execute, fire the next advance_isr "now" if (e_steps[TOOL_E_INDEX]) nextAdvanceISR = 0; - #endif + + #endif // LIN_ADVANCE // Calculate new timer value if (step_events_completed <= (uint32_t)current_block->accelerate_until) { @@ -705,33 +666,9 @@ void Stepper::isr() { current_estep_rate[TOOL_E_INDEX] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17; #endif } - - #elif ENABLED(ADVANCE) - - advance += advance_rate * step_loops; - //NOLESS(advance, current_block->advance); - - const long advance_whole = advance >> 8, - advance_factor = advance_whole - old_advance; - - // Do E steps + advance steps - #if ENABLED(MIXING_EXTRUDER) - // ...for mixing steppers proportionally - MIXING_STEPPERS_LOOP(j) - e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; - #else - // ...for the active extruder - e_steps[TOOL_E_INDEX] += advance_factor; - #endif - - old_advance = advance_whole; - - #endif // ADVANCE or LIN_ADVANCE - - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - // TODO: HAL eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops); - #endif + + #endif // LIN_ADVANCE } else if (step_events_completed > (uint32_t)current_block->decelerate_after) { HAL_TIMER_TYPE step_rate; @@ -765,30 +702,9 @@ void Stepper::isr() { current_estep_rate[TOOL_E_INDEX] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8) >> 17; #endif } - - #elif ENABLED(ADVANCE) - - advance -= advance_rate * step_loops; - NOLESS(advance, final_advance); - - // Do E steps + advance steps - const long advance_whole = advance >> 8, - advance_factor = advance_whole - old_advance; - - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) - e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; - #else - e_steps[TOOL_E_INDEX] += advance_factor; - #endif - - old_advance = advance_whole; - - #endif // ADVANCE or LIN_ADVANCE - - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], timer, step_loops); - #endif + + #endif // LIN_ADVANCE } else { @@ -807,7 +723,7 @@ void Stepper::isr() { step_loops = step_loops_nominal; } - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) #ifdef CPU_32_BIT // Make sure stepper interrupt does not monopolise CPU by adjusting count to give about 8 us room HAL_TIMER_TYPE stepper_timer_count = HAL_timer_get_count(STEP_TIMER_NUM), @@ -823,12 +739,12 @@ void Stepper::isr() { current_block = NULL; planner.discard_current_block(); } - #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) + #if DISABLED(LIN_ADVANCE) HAL_ENABLE_ISRs(); // re-enable ISRs #endif } -#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) +#if ENABLED(LIN_ADVANCE) #define CYCLES_EATEN_E (E_STEPPERS * 5) #define EXTRA_CYCLES_E (STEP_PULSE_CYCLES - (CYCLES_EATEN_E)) @@ -968,7 +884,7 @@ void Stepper::isr() { HAL_ENABLE_ISRs(); } -#endif // ADVANCE or LIN_ADVANCE +#endif // LIN_ADVANCE void Stepper::init() { @@ -1166,12 +1082,10 @@ void Stepper::init() { ENABLE_STEPPER_DRIVER_INTERRUPT(); - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + #if ENABLED(LIN_ADVANCE) for (uint8_t i = 0; i < COUNT(e_steps); i++) e_steps[i] = 0; - #if ENABLED(LIN_ADVANCE) - ZERO(current_adv_steps); - #endif - #endif // ADVANCE || LIN_ADVANCE + ZERO(current_adv_steps); + #endif endstops.enable(true); // Start with endstops active. After homing they can be disabled sei(); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index bf3c164976..c87c4ea1dd 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -90,25 +90,19 @@ class Stepper { static long counter_X, counter_Y, counter_Z, counter_E; static volatile uint32_t step_events_completed; // The number of step events executed in the current block - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + #if ENABLED(LIN_ADVANCE) static HAL_TIMER_TYPE nextMainISR, nextAdvanceISR, eISR_Rate; #define _NEXT_ISR(T) nextMainISR = T - #if ENABLED(LIN_ADVANCE) - static volatile int e_steps[E_STEPPERS]; - static int final_estep_rate; - static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s] - static int current_adv_steps[E_STEPPERS]; // The amount of current added esteps due to advance. - // i.e., the current amount of pressure applied - // to the spring (=filament). - #else - static long e_steps[E_STEPPERS]; - static long advance_rate, advance, final_advance; - static long old_advance; - #endif + static volatile int e_steps[E_STEPPERS]; + static int final_estep_rate; + static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s] + static int current_adv_steps[E_STEPPERS]; // The amount of current added esteps due to advance. + // i.e., the current amount of pressure applied + // to the spring (=filament). #else #define _NEXT_ISR(T) HAL_timer_set_count(STEP_TIMER_NUM, T); - #endif // ADVANCE or LIN_ADVANCE + #endif // LIN_ADVANCE static long acceleration_time, deceleration_time; //unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate; @@ -157,7 +151,7 @@ class Stepper { static void isr(); - #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + #if ENABLED(LIN_ADVANCE) static void advance_isr(); static void advance_isr_scheduler(); #endif @@ -344,26 +338,6 @@ class Stepper { set_directions(); } - #if ENABLED(ADVANCE) - - advance = current_block->initial_advance; - final_advance = current_block->final_advance; - - // Do E steps + advance steps - #if ENABLED(MIXING_EXTRUDER) - long advance_factor = (advance >> 8) - old_advance; - // ...for mixing steppers proportionally - MIXING_STEPPERS_LOOP(j) - e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; - #else - // ...for the active extruder - e_steps[TOOL_E_INDEX] += ((advance >> 8) - old_advance); - #endif - - old_advance = advance >> 8; - - #endif - deceleration_time = 0; // step_rate to timer interval OCR1A_nominal = calc_timer(current_block->nominal_rate);