diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 067e4c87e10..8586c4e54fa 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index aded988bba3..26d238ad672 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h index 067e4c87e10..8586c4e54fa 100644 --- a/Marlin/src/config/default/Configuration.h +++ b/Marlin/src/config/default/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index aded988bba3..26d238ad672 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h index 32c6ff68e9b..7c7eb94125e 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h @@ -858,9 +858,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 1f3561684fa..776decb7776 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 4, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h index 5f10047fd5a..b679fc6652a 100644 --- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h +++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h index 2ac19df0c99..c8651aa1227 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration.h @@ -917,9 +917,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 27c62cfdec2..38ee9e67b9d 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h index 2f5de56fe2f..841a2260034 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration.h @@ -845,9 +845,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 8cb51bb3c14..0dccff8e618 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h index 3067dc208de..18847e905db 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h index aded988bba3..26d238ad672 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h index 841713782da..78a8241588c 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 412dda323f4..3a7052615af 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h index 649b3b4447c..7b7d42c0a10 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h index 53f3c847133..0fcb9edb2eb 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h index c602530f665..782f8bb2a49 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h @@ -826,9 +826,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 71e20c48bfa..8b8a94d4d51 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h index 3db73defdc4..bc198d460f3 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h @@ -839,9 +839,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 6e5f5c87717..dbc4ea82985 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -835,12 +843,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h index d59312da3b5..3536e077276 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h @@ -826,9 +826,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 71e20c48bfa..8b8a94d4d51 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h index d0684166880..6421333b46c 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration.h +++ b/Marlin/src/config/examples/Cartesio/Configuration.h @@ -837,9 +837,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index cf6fa1f30fc..ba19ef42b78 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h index 33aab93c91c..fa5e1ebff58 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h @@ -848,9 +848,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 128bb29df1c..9bf413d6fd1 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h index a976b8fbfeb..dcfb9db9846 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index e2a09e10b3a..9dc7d3f9f1d 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h index 6b987b10497..43ca4c35da2 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h @@ -857,9 +857,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index 166587aa6b1..3573d33b97e 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration.h b/Marlin/src/config/examples/Creality/CR-8/Configuration.h index a92fadd9165..6454a826d16 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration.h @@ -848,9 +848,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h index 45898905d08..d97d93b6f4e 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h index 3082f0f028a..3c13a766096 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h @@ -842,9 +842,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index 0402deab0ec..48573751b49 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h index 687f7bb75d5..c2f9ac6df1c 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h @@ -842,9 +842,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h index ff6c86bcb9f..c93ec7a1121 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h index 54bed72f601..5d22e744da8 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h @@ -848,9 +848,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h index 45898905d08..d97d93b6f4e 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h index 4152cba2581..b79398bf355 100644 --- a/Marlin/src/config/examples/Felix/Configuration.h +++ b/Marlin/src/config/examples/Felix/Configuration.h @@ -820,9 +820,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 9f61140daf1..c54a9094014 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h index 80ceacd4dca..ba5f1e55b07 100644 --- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h +++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h @@ -820,9 +820,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h index b23371b3f8a..361f185a7e5 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h @@ -844,9 +844,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index e9ad23b8734..751080e1aee 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index 664f11cbf6e..c9fc21aa99f 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -853,9 +853,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 49aee8722e9..858b125506a 100644 --- a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 7b83b0a0eef..1177e3cad35 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -854,9 +854,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index cda7f70c27a..94821804a11 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -853,9 +853,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 95f0a38b6ab..1d6a8c19eec 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 58fcca7a6e8..d0bee3f0d2e 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index 92f50426d6d..ae2d47433b6 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 58fcca7a6e8..d0bee3f0d2e 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h index 7c0ffae6c67..20ff78d9d0d 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h @@ -842,9 +842,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 a4d4ca066bd..20a76eb5e0b 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration.h b/Marlin/src/config/examples/JGAurora/A5/Configuration.h index 6ac26542d3d..a0b97c6aabd 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration.h @@ -850,9 +850,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index cb5c2910368..4ff8e379bda 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/MakerParts/Configuration.h b/Marlin/src/config/examples/MakerParts/Configuration.h index 9bc73e9947b..e9fed6c7e91 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration.h +++ b/Marlin/src/config/examples/MakerParts/Configuration.h @@ -631,7 +631,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_ACCELERATION { MAX_XYAXIS_ACCEL, MAX_XYAXIS_ACCEL, 100, 200 } +#define DEFAULT_MAX_ACCELERATION { MAX_XYAXIS_ACCEL, MAX_XYAXIS_ACCEL, 10, 200 } /** * Default Acceleration (change/s) change = mm/s @@ -858,9 +858,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 14e96f76053..0107419bf1b 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h index 61fb99745e8..792f512dba5 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h @@ -862,9 +862,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 91363bb9172..7451a2b8fc8 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration.h b/Marlin/src/config/examples/Malyan/M200/Configuration.h index 7a8cc2aa96b..105992ee748 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration.h @@ -837,9 +837,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index f690d9335ee..ef015ba9746 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h index a181f2ba714..4ddb93c90db 100644 --- a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h @@ -842,9 +842,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h index 5caa9b353c3..4335127a210 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h @@ -842,9 +842,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index d3566efd10a..f7a906139c0 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration.h b/Marlin/src/config/examples/Mks/Sbase/Configuration.h index 3022110978b..72c5f624a81 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index 6a59bd4dbf7..b87d2b61b92 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -835,12 +843,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 4 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h index 73addef15ef..2f3764d99e8 100644 --- a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h +++ b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h @@ -878,9 +878,6 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h index 03d499d9aa6..4a337333d8c 100644 --- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h index 0b4edda3ebb..96203ea78a2 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration.h +++ b/Marlin/src/config/examples/RigidBot/Configuration.h @@ -836,9 +836,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index 3ca22904409..215fd16ab59 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index efc409df605..956df12e33a 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -851,9 +851,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index af6fbba0caa..225bcdfd1fd 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/STM32F10/Configuration.h b/Marlin/src/config/examples/STM32F10/Configuration.h index 0048662fb07..f96e34dc303 100644 --- a/Marlin/src/config/examples/STM32F10/Configuration.h +++ b/Marlin/src/config/examples/STM32F10/Configuration.h @@ -840,9 +840,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/STM32F4/Configuration.h b/Marlin/src/config/examples/STM32F4/Configuration.h index 9e8e421edc1..b6971ab744e 100644 --- a/Marlin/src/config/examples/STM32F4/Configuration.h +++ b/Marlin/src/config/examples/STM32F4/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration.h b/Marlin/src/config/examples/Sanguinololu/Configuration.h index 0551fa6912f..791aae3f869 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration.h @@ -869,9 +869,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 29a75957bd0..3bda74ce4d3 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/TheBorg/Configuration.h b/Marlin/src/config/examples/TheBorg/Configuration.h index 9a8a3a81125..93dfeb0c6e7 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration.h +++ b/Marlin/src/config/examples/TheBorg/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index a02e2268aa1..9a064958fbe 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h index 2ec5fc2baef..bb937c67b7e 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h @@ -889,9 +889,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba steppers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 7415412f4ad..eae3b9aed55 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Tronxy/X1/Configuration.h b/Marlin/src/config/examples/Tronxy/X1/Configuration.h index 7c0106f875e..cafc48dbe96 100644 --- a/Marlin/src/config/examples/Tronxy/X1/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X1/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h index 643e6ae7de3..44ba2393607 100644 --- a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h index 90ca20f8362..0fa57cd306c 100644 --- a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h @@ -849,9 +849,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h index d637a69c4f5..09d6bbd453d 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index 91b4eef7021..2b9b4b15f69 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration.h b/Marlin/src/config/examples/Velleman/K8200/Configuration.h index e9a0623a683..745733b1dc9 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration.h @@ -867,9 +867,6 @@ #define INVERT_Y_DIR false // K8200: false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 32c84639d75..26295c1e65c 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -453,6 +453,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -830,12 +838,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h index 2d2d7082f81..794d215a7ad 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index d2cbf76effd..848e57846cc 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h index 03851fbfe62..5eaffedfe97 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h index a154d1fdd62..ed48e0d00b7 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -848,9 +848,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 2ebf20b82d5..dd4471ffa52 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h index 2b781674357..63bb6fbf856 100644 --- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h +++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h @@ -838,9 +838,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index e3a94c68698..10084ef0409 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -970,9 +970,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 a26c0308179..96b96424294 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 @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h index 050f6a21833..82ab7866dc8 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h @@ -969,9 +969,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 47781e1b56e..200d99d4d5f 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h index d0f67ed0589..c95791a122a 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -969,9 +969,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 48d39fe08b4..1538174b1f9 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 @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h index 35b900a533a..52429cb741c 100644 --- a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -972,9 +972,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h index 08f512726b5..863ab7b3aad 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration.h +++ b/Marlin/src/config/examples/delta/generic/Configuration.h @@ -957,9 +957,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index 48d39fe08b4..1538174b1f9 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h index 3e05de99805..b0a8155ee1f 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h @@ -959,9 +959,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 48d39fe08b4..1538174b1f9 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h index e03df8633c3..1a5190c1291 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h @@ -960,9 +960,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 afa2ac030ae..c9f9667bd57 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -457,6 +457,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -834,12 +842,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h index 04f54a13aa7..0d742089b2d 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h @@ -960,9 +960,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 1469f244d96..8ca6fab8182 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -452,6 +452,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -829,12 +837,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h index cf5c93f420a..2617c6f754c 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h @@ -851,9 +851,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. 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 3c225ec0734..7db4b97d56b 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h index 7642795e8ad..5f1e4d8e864 100644 --- a/Marlin/src/config/examples/makibox/Configuration.h +++ b/Marlin/src/config/examples/makibox/Configuration.h @@ -841,9 +841,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index 91999d98f1f..5da1710faf6 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,12 +835,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h index bedea2d4f7c..a50e53b03d4 100644 --- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h +++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h @@ -840,9 +840,6 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h index 266f215767d..5b202d729da 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h @@ -833,9 +833,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true -// Enable this option for Toshiba stepper drivers -#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 001834a8db2..41d2d80237b 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -827,11 +835,24 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ -#define MINIMUM_STEPPER_PULSE 2 +#define MINIMUM_STEPPER_PULSE 30 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 15000 // @section temperature diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h index 0c7d9a5d81d..c3f1878b266 100644 --- a/Marlin/src/config/examples/wt150/Configuration.h +++ b/Marlin/src/config/examples/wt150/Configuration.h @@ -843,9 +843,6 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false -// Enable this option for Toshiba stepper drivers -//#define CONFIG_STEPPERS_TOSHIBA - // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 3f7d68db8df..5acd4a3e3d6 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -450,6 +450,14 @@ //#define JUNCTION_DEVIATION_INCLUDE_E #endif +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] @@ -828,12 +836,25 @@ /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers */ #define MINIMUM_STEPPER_PULSE 2 +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + // @section temperature // Control heater 0 and heater 1 in parallel. diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 338c76ffea8..dd018a11544 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -215,22 +215,6 @@ #define DEFAULT_KEEPALIVE_INTERVAL 2 #endif -#ifdef CPU_32_BIT - /** - * Hidden options for developer - */ - // Double stepping starts at STEP_DOUBLER_FREQUENCY + 1, quad stepping starts at STEP_DOUBLER_FREQUENCY * 2 + 1 - #ifndef STEP_DOUBLER_FREQUENCY - #if ENABLED(LIN_ADVANCE) - #define STEP_DOUBLER_FREQUENCY 60000 // Hz - #else - #define STEP_DOUBLER_FREQUENCY 80000 // Hz - #endif - #endif - // Disable double / quad stepping - //#define DISABLE_MULTI_STEPPING -#endif - /** * Provide a MAX_AUTORETRACT for older configs */ @@ -238,23 +222,6 @@ #define MAX_AUTORETRACT 99 #endif -/** - * MAX_STEP_FREQUENCY differs for TOSHIBA - */ -#if ENABLED(CONFIG_STEPPERS_TOSHIBA) - #ifdef CPU_32_BIT - #define MAX_STEP_FREQUENCY STEP_DOUBLER_FREQUENCY // Max step frequency for Toshiba Stepper Controllers, 96kHz is close to maximum for an Arduino Due - #else - #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers - #endif -#else - #ifdef CPU_32_BIT - #define MAX_STEP_FREQUENCY (STEP_DOUBLER_FREQUENCY * 4) // Max step frequency for the Due is approx. 330kHz - #else - #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - #endif -#endif - // MS1 MS2 Stepper Driver Microstepping mode table #define MICROSTEP1 LOW,LOW #if ENABLED(HEROIC_STEPPER_DRIVERS) @@ -1346,15 +1313,6 @@ #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT #endif -// Stepper pulse duration, in cycles -#define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) -#ifdef CPU_32_BIT - // Add additional delay for between direction signal and pulse signal of stepper - #ifndef STEPPER_DIRECTION_DELAY - #define STEPPER_DIRECTION_DELAY 0 // time in microseconds - #endif -#endif - #ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation #undef UI_VOLTAGE_LEVEL #undef RADDS_DISPLAY @@ -1486,4 +1444,149 @@ #define USE_EXECUTE_COMMANDS_IMMEDIATE #endif +// Calculate a default maximum stepper rate, if not supplied +#ifndef MAXIMUM_STEPPER_RATE + #if MINIMUM_STEPPER_PULSE + #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (MINIMUM_STEPPER_PULSE))) + #else + #define MAXIMUM_STEPPER_RATE 500000UL + #endif +#endif + +// +// Estimate the amount of time the ISR will take to execute +// +#ifdef CPU_32_BIT + + // The base ISR takes 792 cycles + #define ISR_BASE_CYCLES 792UL + + // Linear advance base time is 64 cycles + #if ENABLED(LIN_ADVANCE) + #define ISR_LA_BASE_CYCLES 64UL + #else + #define ISR_LA_BASE_CYCLES 0UL + #endif + + // S curve interpolation adds 40 cycles + #if ENABLED(S_CURVE_ACCELERATION) + #define ISR_S_CURVE_CYCLES 40UL + #else + #define ISR_S_CURVE_CYCLES 0UL + #endif + + // Stepper Loop base cycles + #define ISR_LOOP_BASE_CYCLES 4UL + + // And each stepper takes 16 cycles + #define ISR_STEPPER_CYCLES 16UL + +#else + + // The base ISR takes 752 cycles + #define ISR_BASE_CYCLES 752UL + + // Linear advance base time is 32 cycles + #if ENABLED(LIN_ADVANCE) + #define ISR_LA_BASE_CYCLES 32UL + #else + #define ISR_LA_BASE_CYCLES 0UL + #endif + + // S curve interpolation adds 160 cycles + #if ENABLED(S_CURVE_ACCELERATION) + #define ISR_S_CURVE_CYCLES 160UL + #else + #define ISR_S_CURVE_CYCLES 0UL + #endif + + // Stepper Loop base cycles + #define ISR_LOOP_BASE_CYCLES 32UL + + // And each stepper takes 88 cycles + #define ISR_STEPPER_CYCLES 88UL + +#endif + +// For each stepper, we add its time +#ifdef HAS_X_STEP + #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES +#else + #define ISR_X_STEPPER_CYCLES 0UL +#endif + +// For each stepper, we add its time +#ifdef HAS_Y_STEP + #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES +#else + #define ISR_Y_STEPPER_CYCLES 0UL +#endif + +// For each stepper, we add its time +#ifdef HAS_Z_STEP + #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES +#else + #define ISR_Z_STEPPER_CYCLES 0UL +#endif + +// E is always interpolated, even for mixing extruders +#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES + +// If linear advance is disabled, then the loop also handles them +#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) + #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * ISR_STEPPER_CYCLES) +#else + #define ISR_MIXING_STEPPER_CYCLES 0UL +#endif + +// And the total minimum loop time is, without including the base +#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) + +// Calculate the minimum MPU cycles needed per pulse to enforce not surpassing the maximum stepper rate +#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((F_CPU) / (MAXIMUM_STEPPER_RATE), ((F_CPU) / 500000UL) * (N)) +#if MINIMUM_STEPPER_PULSE + #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(MINIMUM_STEPPER_PULSE) +#else + #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1) +#endif + +// But the user could be enforcing a minimum time, so the loop time is +#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES)) + +// If linear advance is enabled, then it is handled separately +#if ENABLED(LIN_ADVANCE) + + // Estimate the minimum LA loop time + #if ENABLED(MIXING_EXTRUDER) + #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) + #else + #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES + #endif + + // And the real loop time + #define ISR_LA_LOOP_CYCLES MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES) + +#else + #define ISR_LA_LOOP_CYCLES 0UL +#endif + +// Now estimate the total ISR execution time in cycles given a step per ISR multiplier +#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) + +// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz) +#define MAX_128X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(128)) +#define MAX_64X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(64)) +#define MAX_32X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(32)) +#define MAX_16X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(16)) +#define MAX_8X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(8)) +#define MAX_4X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(4)) +#define MAX_2X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(2)) +#define MAX_1X_STEP_ISR_FREQUENCY (F_CPU / ISR_EXECUTION_CYCLES(1)) + +// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz) +#define MIN_STEP_ISR_FREQUENCY MAX_1X_STEP_ISR_FREQUENCY + +// Disable multiple steps per ISR +//#define DISABLE_MULTI_STEPPING + #endif // CONDITIONALS_POST_H diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index af16e6d55f9..d1e423c3d0e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -679,9 +679,9 @@ void Planner::init() { return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16); } #else - // All the other 32 CPUs can easily perform the inverse using hardware division, + // All other 32-bit MPUs can easily do inverse using hardware division, // so we don't need to reduce precision or to use assembly language at all. - // This routine, for all the other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d + // This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { return 0xFFFFFFFF / d; } #endif #endif @@ -1646,10 +1646,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Bail if this is a zero-length block if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; - // For a mixing extruder, get a magnified step_event_count for each + // For a mixing extruder, get a magnified esteps for each #if ENABLED(MIXING_EXTRUDER) for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - block->mix_event_count[i] = mixing_factor[i] * block->step_event_count; + block->mix_steps[i] = mixing_factor[i] * ( + #if ENABLED(LIN_ADVANCE) + esteps + #else + block->step_event_count + #endif + ); #endif #if FAN_COUNT > 0 diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 8e5d52b098d..94dda12ff9c 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -108,7 +108,7 @@ typedef struct { uint8_t active_extruder; // The extruder to move (if E move) #if ENABLED(MIXING_EXTRUDER) - uint32_t mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers + uint32_t mix_steps[MIXING_STEPPERS]; // Scaled steps[E_AXIS] for the mixing steppers #endif // Settings for the trapezoid generator @@ -130,7 +130,7 @@ typedef struct { // Advance extrusion #if ENABLED(LIN_ADVANCE) bool use_advance_lead; - uint16_t advance_speed, // Timer value for extruder speed offset + uint16_t advance_speed, // STEP timer value for extruder speed offset ISR max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!) final_adv_steps; // advance steps due to exit speed float e_D_ratio; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 6f21d84aaac..fdedbb5f910 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -46,6 +46,29 @@ * and Philipp Tiefenbacher. */ +/** + * __________________________ + * /| |\ _________________ ^ + * / | | \ /| |\ | + * / | | \ / | | \ s + * / | | | | | \ p + * / | | | | | \ e + * +-----+------------------------+---+--+---------------+----+ e + * | BLOCK 1 | BLOCK 2 | d + * + * time -----> + * + * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates + * first block->accelerate_until step_events_completed, then keeps going at constant speed until + * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. + * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. + */ + +/** + * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and + * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html + */ + /** * Jerk controlled movements planner added Apr 2018 by Eduardo José Tagle. * Equations based on Synthethos TinyG2 sources, but the fixed-point @@ -97,10 +120,14 @@ block_t* Stepper::current_block = NULL; // A pointer to the block currently bei // private: uint8_t Stepper::last_direction_bits = 0, - Stepper::last_movement_extruder = 0xFF, Stepper::axis_did_move; + bool Stepper::abort_current_block; +#if DISABLED(MIXING_EXTRUDER) + uint8_t Stepper::last_moved_extruder = 0xFF; +#endif + #if ENABLED(X_DUAL_ENDSTOPS) bool Stepper::locked_X_motor = false, Stepper::locked_X2_motor = false; #endif @@ -111,19 +138,30 @@ bool Stepper::abort_current_block; bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false; #endif -/** - * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and - * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html - * - * The implementation used here additionally rounds up the starting seed. - */ +uint32_t Stepper::acceleration_time, Stepper::deceleration_time; +uint8_t Stepper::steps_per_isr; -int32_t Stepper::counter_X = 0, - Stepper::counter_Y = 0, - Stepper::counter_Z = 0, - Stepper::counter_E = 0; +#if DISABLED(ADAPTIVE_STEP_SMOOTHING) + constexpr +#endif + uint8_t Stepper::oversampling_factor; -uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block +int32_t Stepper::delta_error[XYZE] = { 0 }; + +uint32_t Stepper::advance_dividend[XYZE] = { 0 }, + Stepper::advance_divisor = 0, + Stepper::step_events_completed = 0, // The number of step events executed in the current block + Stepper::accelerate_until, // The point from where we need to stop acceleration + Stepper::decelerate_after, // The point from where we need to start decelerating + Stepper::step_event_count; // The total event count for the current block + +#if ENABLED(MIXING_EXTRUDER) + int32_t Stepper::delta_error_m[MIXING_STEPPERS]; + uint32_t Stepper::advance_dividend_m[MIXING_STEPPERS], + Stepper::advance_divisor_m; +#else + int8_t Stepper::active_extruder; // Active extruder +#endif #if ENABLED(S_CURVE_ACCELERATION) int32_t __attribute__((used)) Stepper::bezier_A __asm__("bezier_A"); // A coefficient in Bézier speed curve with alias for assembler @@ -132,55 +170,38 @@ uint32_t Stepper::step_events_completed = 0; // The number of step events execut uint32_t __attribute__((used)) Stepper::bezier_F __asm__("bezier_F"); // F coefficient in Bézier speed curve with alias for assembler uint32_t __attribute__((used)) Stepper::bezier_AV __asm__("bezier_AV"); // AV coefficient in Bézier speed curve with alias for assembler #ifdef __AVR__ - bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative + bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative #endif bool Stepper::bezier_2nd_half; // =false If Bézier curve has been initialized or not #endif uint32_t Stepper::nextMainISR = 0; -bool Stepper::all_steps_done = false; #if ENABLED(LIN_ADVANCE) - uint32_t Stepper::LA_decelerate_after; + constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF; + uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER, + Stepper::LA_isr_rate = LA_ADV_NEVER; + uint16_t Stepper::LA_current_adv_steps = 0, + Stepper::LA_final_adv_steps, + Stepper::LA_max_adv_steps; - constexpr uint32_t ADV_NEVER = 0xFFFFFFFF; - uint32_t Stepper::nextAdvanceISR = ADV_NEVER, - Stepper::eISR_Rate = ADV_NEVER; - uint16_t Stepper::current_adv_steps = 0, - Stepper::final_adv_steps, - Stepper::max_adv_steps; + int8_t Stepper::LA_steps = 0; - int8_t Stepper::e_steps = 0; - - #if E_STEPPERS > 1 - int8_t Stepper::LA_active_extruder; // Copy from current executed block. Needed because current_block is set to NULL "too early". - #else - constexpr int8_t Stepper::LA_active_extruder; - #endif - - bool Stepper::use_advance_lead; + bool Stepper::LA_use_advance_lead; #endif // LIN_ADVANCE -uint32_t Stepper::acceleration_time, Stepper::deceleration_time; - -volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 }; -int8_t Stepper::count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; - -#if ENABLED(MIXING_EXTRUDER) - int32_t Stepper::counter_m[MIXING_STEPPERS]; -#endif - -uint32_t Stepper::ticks_nominal; -uint8_t Stepper::step_loops, Stepper::step_loops_nominal; - +int32_t Stepper::ticks_nominal = -1; #if DISABLED(S_CURVE_ACCELERATION) uint32_t Stepper::acc_step_rate; // needed for deceleration start point #endif volatile int32_t Stepper::endstops_trigsteps[XYZ]; +volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 }; +int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 }; + #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ if (homing_dual_axis) { \ @@ -213,7 +234,7 @@ volatile int32_t Stepper::endstops_trigsteps[XYZ]; X2_DIR_WRITE(v); \ } \ else { \ - if (current_block->active_extruder) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ + if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ } #define X_APPLY_STEP(v,ALWAYS) \ if (extruder_duplication_enabled || ALWAYS) { \ @@ -221,7 +242,7 @@ volatile int32_t Stepper::endstops_trigsteps[XYZ]; X2_STEP_WRITE(v); \ } \ else { \ - if (current_block->active_extruder) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ + if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ } #else #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) @@ -253,26 +274,9 @@ volatile int32_t Stepper::endstops_trigsteps[XYZ]; #endif #if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(current_block->active_extruder, v) + #define E_APPLY_STEP(v,Q) E_STEP_WRITE(active_extruder, v) #endif -/** - * __________________________ - * /| |\ _________________ ^ - * / | | \ /| |\ | - * / | | \ / | | \ s - * / | | | | | \ p - * / | | | | | \ e - * +-----+------------------------+---+--+---------------+----+ e - * | BLOCK 1 | BLOCK 2 | d - * - * time -----> - * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. - */ void Stepper::wake_up() { // TCNT1 = 0; ENABLE_STEPPER_DRIVER_INTERRUPT(); @@ -308,14 +312,25 @@ void Stepper::set_directions() { #endif #if DISABLED(LIN_ADVANCE) - if (motor_direction(E_AXIS)) { - REV_E_DIR(current_block->active_extruder); - count_direction[E_AXIS] = -1; - } - else { - NORM_E_DIR(current_block->active_extruder); - count_direction[E_AXIS] = 1; - } + #if ENABLED(MIXING_EXTRUDER) + if (motor_direction(E_AXIS)) { + MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); + count_direction[E_AXIS] = -1; + } + else { + MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); + count_direction[E_AXIS] = 1; + } + #else + if (motor_direction(E_AXIS)) { + REV_E_DIR(active_extruder); + count_direction[E_AXIS] = -1; + } + else { + NORM_E_DIR(active_extruder); + count_direction[E_AXIS] = 1; + } + #endif #endif // !LIN_ADVANCE } @@ -1128,17 +1143,6 @@ void Stepper::set_directions() { * Stepper Driver Interrupt * * Directly pulses the stepper motors at high frequency. - * - * AVR : - * Timer 1 runs at a base frequency of 2MHz, with this ISR using OCR1A compare mode. - * - * OCR1A Frequency - * 1 2 MHz - * 50 40 KHz - * 100 20 KHz - capped max rate - * 200 10 KHz - nominal max rate - * 2000 1 KHz - sleep rate - * 4000 500 Hz - init rate */ HAL_STEP_TIMER_ISR { @@ -1156,9 +1160,11 @@ HAL_STEP_TIMER_ISR { #endif void Stepper::isr() { - - // Disable interrupts, to avoid ISR preemption while we reprogram the period - DISABLE_ISRS(); + #ifndef __AVR__ + // Disable interrupts, to avoid ISR preemption while we reprogram the period + // (AVR enters the ISR with global interrupts disabled, so no need to do it here) + DISABLE_ISRS(); + #endif // Program timer compare for the maximum period, so it does NOT // flag an interrupt while this ISR is running - So changes from small @@ -1206,7 +1212,7 @@ void Stepper::isr() { #if ENABLED(LIN_ADVANCE) // Compute the time remaining for the advance isr - if (nextAdvanceISR != ADV_NEVER) nextAdvanceISR -= interval; + if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval; #endif /** @@ -1248,12 +1254,17 @@ void Stepper::isr() { /** * Get the current tick value + margin * Assuming at least 6µs between calls to this ISR... - * On AVR the ISR epilogue is estimated at 40 instructions - close to 2.5µS. - * On ARM the ISR epilogue is estimated at 10 instructions - close to 200nS. - * In either case leave at least 8µS for other tasks to execute - That allows - * up to 100khz stepping rates + * On AVR the ISR epilogue+prologue is estimated at 100 instructions - Give 8µs as margin + * On ARM the ISR epilogue+prologue is estimated at 20 instructions - Give 1µs as margin */ - min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t((HAL_TICKS_PER_US) * 8); // ISR never takes more than 1ms, so this shouldn't cause trouble + min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t( + #ifdef __AVR__ + 8 + #else + 1 + #endif + * (HAL_TICKS_PER_US) + ); /** * NB: If for some reason the stepper monopolizes the MPU, eventually the @@ -1298,98 +1309,42 @@ void Stepper::stepper_pulse_phase_isr() { // If there is no current block, do nothing if (!current_block) return; - // Take multiple steps per interrupt (For high speed moves) - all_steps_done = false; - for (uint8_t i = step_loops; i--;) { + // Count of pending loops and events for this iteration + const uint32_t pending_events = step_event_count - step_events_completed; + uint8_t events_to_do = MIN(pending_events, steps_per_isr); + + // Just update the value we will get at the end of the loop + step_events_completed += events_to_do; + + #if MINIMUM_STEPPER_PULSE + // Get the timer count and estimate the end of the pulse + hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t((HAL_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)); + #endif + + // Take multiple steps per interrupt (For high speed moves) + do { - #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN - // Advance the Bresenham counter; start a pulse if the axis needs a step + // Start an active pulse, if Bresenham says so, and update position #define PULSE_START(AXIS) do{ \ - _COUNTER(AXIS) += current_block->steps[_AXIS(AXIS)]; \ - if (_COUNTER(AXIS) >= 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); } \ - }while(0) - - // Advance the Bresenham counter; start a pulse if the axis needs a step - #define STEP_TICK(AXIS) do { \ - if (_COUNTER(AXIS) >= 0) { \ - _COUNTER(AXIS) -= current_block->step_event_count; \ + delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \ + if (delta_error[_AXIS(AXIS)] >= 0) { \ + _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); \ count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ } \ }while(0) - // Stop an active pulse, if any - #define PULSE_STOP(AXIS) _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0) - - /** - * Estimate the number of cycles that the stepper logic already takes - * up between the start and stop of the X stepper pulse. - * - * Currently this uses very modest estimates of around 5 cycles. - * True values may be derived by careful testing. - * - * Once any delay is added, the cost of the delay code itself - * may be subtracted from this value to get a more accurate delay. - * Delays under 20 cycles (1.25µs) will be very accurate, using NOPs. - * Longer delays use a loop. The resolution is 8 cycles. - */ - #if HAS_X_STEP - #define _CYCLE_APPROX_1 5 - #else - #define _CYCLE_APPROX_1 0 - #endif - #if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define _CYCLE_APPROX_2 _CYCLE_APPROX_1 + 4 - #else - #define _CYCLE_APPROX_2 _CYCLE_APPROX_1 - #endif - #if HAS_Y_STEP - #define _CYCLE_APPROX_3 _CYCLE_APPROX_2 + 5 - #else - #define _CYCLE_APPROX_3 _CYCLE_APPROX_2 - #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define _CYCLE_APPROX_4 _CYCLE_APPROX_3 + 4 - #else - #define _CYCLE_APPROX_4 _CYCLE_APPROX_3 - #endif - #if HAS_Z_STEP - #define _CYCLE_APPROX_5 _CYCLE_APPROX_4 + 5 - #else - #define _CYCLE_APPROX_5 _CYCLE_APPROX_4 - #endif - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 + 4 - #else - #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 - #endif - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6 - #else - #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + 5 - #endif - #else - #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 - #endif - - #define CYCLES_EATEN_XYZE _CYCLE_APPROX_7 - #define EXTRA_CYCLES_XYZE (STEP_PULSE_CYCLES - (CYCLES_EATEN_XYZE)) - - /** - * If a minimum pulse time was specified get the timer 0 value. - * - * On AVR the TCNT0 timer has an 8x prescaler, so it increments every 8 cycles. - * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz. - * 20 counts of TCNT0 -by itself- is a good pulse delay. - * 10µs = 160 or 200 cycles. - */ - #if EXTRA_CYCLES_XYZE > 20 - hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM); - #endif + // Stop an active pulse, if any, and adjust error term + #define PULSE_STOP(AXIS) do { \ + if (delta_error[_AXIS(AXIS)] >= 0) { \ + delta_error[_AXIS(AXIS)] -= advance_divisor; \ + _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0); \ + } \ + }while(0) + // Pulse start #if HAS_X_STEP PULSE_START(X); #endif @@ -1400,64 +1355,48 @@ void Stepper::stepper_pulse_phase_isr() { PULSE_START(Z); #endif + // Pulse E/Mixing extruders #if ENABLED(LIN_ADVANCE) - counter_E += current_block->steps[E_AXIS]; - if (counter_E >= 0) { - #if DISABLED(MIXING_EXTRUDER) - // Don't step E here for mixing extruder - motor_direction(E_AXIS) ? --e_steps : ++e_steps; - #endif + // Tick the E axis, correct error term and update position + delta_error[E_AXIS] += advance_dividend[E_AXIS]; + if (delta_error[E_AXIS] >= 0) { + count_position[E_AXIS] += count_direction[E_AXIS]; + delta_error[E_AXIS] -= advance_divisor; + + // Don't step E here - But remember the number of steps to perform + motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; } - - #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 - #else // !LIN_ADVANCE - use linear interpolation for E also - #if ENABLED(MIXING_EXTRUDER) - // Keep updating the single E axis - counter_E += current_block->steps[E_AXIS]; - // Tick the counters used for this mix + + // Tick the E axis + delta_error[E_AXIS] += advance_dividend[E_AXIS]; + if (delta_error[E_AXIS] >= 0) { + count_position[E_AXIS] += count_direction[E_AXIS]; + delta_error[E_AXIS] -= advance_divisor; + } + + // Tick the counters used for this mix in proper proportion MIXING_STEPPERS_LOOP(j) { // Step mixing steppers (proportionally) - counter_m[j] += current_block->steps[E_AXIS]; + delta_error_m[j] += advance_dividend_m[j]; // Step when the counter goes over zero - if (counter_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); + if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); } + #else // !MIXING_EXTRUDER PULSE_START(E); #endif #endif // !LIN_ADVANCE - #if HAS_X_STEP - STEP_TICK(X); - #endif - #if HAS_Y_STEP - STEP_TICK(Y); - #endif - #if HAS_Z_STEP - STEP_TICK(Z); - #endif - - STEP_TICK(E); // Always tick the single E axis - - // For minimum pulse time wait before stopping pulses - #if EXTRA_CYCLES_XYZE > 20 - while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM); - #elif EXTRA_CYCLES_XYZE > 0 - DELAY_NS(EXTRA_CYCLES_XYZE * NANOSECONDS_PER_CYCLE); + #if MINIMUM_STEPPER_PULSE + // Just wait for the requested pulse duration + while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + // Add to the value, the value needed for the pulse end and ensuring the maximum driver rate is enforced + pulse_end += hal_timer_t(MIN_STEPPER_PULSE_CYCLES) - hal_timer_t((HAL_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)); #endif + // Pulse stop #if HAS_X_STEP PULSE_STOP(X); #endif @@ -1471,8 +1410,8 @@ void Stepper::stepper_pulse_phase_isr() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) MIXING_STEPPERS_LOOP(j) { - if (counter_m[j] >= 0) { - counter_m[j] -= current_block->mix_event_count[j]; + if (delta_error_m[j] >= 0) { + delta_error_m[j] -= advance_divisor_m; E_STEP_WRITE(j, INVERT_E_STEP_PIN); } } @@ -1481,19 +1420,20 @@ void Stepper::stepper_pulse_phase_isr() { #endif #endif // !LIN_ADVANCE - if (++step_events_completed >= current_block->step_event_count) { - all_steps_done = true; - break; - } + // Decrement the count of pending pulses to do + --events_to_do; - // For minimum pulse time wait after stopping pulses also - #if EXTRA_CYCLES_XYZE > 20 - if (i) while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - #elif EXTRA_CYCLES_XYZE > 0 - if (i) DELAY_NS(EXTRA_CYCLES_XYZE * NANOSECONDS_PER_CYCLE); + #if MINIMUM_STEPPER_PULSE + // For minimum pulse time wait after stopping pulses also + if (events_to_do) { + // Just wait for the requested pulse duration + while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + // Add to the value, the time that the pulse must be active (to be used on the next loop) + pulse_end += hal_timer_t((HAL_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)); + } #endif - } // steps_loop + } while (events_to_do); } // This is the last half of the stepper interrupt: This one processes and @@ -1508,101 +1448,119 @@ uint32_t Stepper::stepper_block_phase_isr() { // If there is a current block if (current_block) { - // Calculate new timer value - if (step_events_completed <= current_block->accelerate_until) { - - #if ENABLED(S_CURVE_ACCELERATION) - // Get the next speed to use (Jerk limited!) - uint32_t acc_step_rate = - acceleration_time < current_block->acceleration_time - ? _eval_bezier_curve(acceleration_time) - : current_block->cruise_rate; - #else - acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; - NOMORE(acc_step_rate, current_block->nominal_rate); - #endif - - // step_rate to timer interval - interval = calc_timer_interval(acc_step_rate); - acceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead) { - if (step_events_completed == step_loops || (e_steps && eISR_Rate != current_block->advance_speed)) { - nextAdvanceISR = 0; // Wake up eISR on first acceleration loop and fire ISR if final adv_rate is reached - eISR_Rate = current_block->advance_speed; - } - } - else { - eISR_Rate = ADV_NEVER; - if (e_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - else if (step_events_completed > current_block->decelerate_after) { - uint32_t step_rate; - - #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... - if (!bezier_2nd_half) { - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); - bezier_2nd_half = true; - } - - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - #else - - // Using the old trapezoidal control - step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? - step_rate = acc_step_rate - step_rate; - NOLESS(step_rate, current_block->final_rate); - } - else - step_rate = current_block->final_rate; - #endif - - // step_rate to timer interval - interval = calc_timer_interval(step_rate); - deceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead) { - if (step_events_completed <= current_block->decelerate_after + step_loops || (e_steps && eISR_Rate != current_block->advance_speed)) { - nextAdvanceISR = 0; // Wake up eISR on first deceleration loop - eISR_Rate = current_block->advance_speed; - } - } - else { - eISR_Rate = ADV_NEVER; - if (e_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - else { - - #if ENABLED(LIN_ADVANCE) - // If there are any esteps, fire the next advance_isr "now" - if (e_steps && eISR_Rate != current_block->advance_speed) nextAdvanceISR = 0; - #endif - - // The timer interval is just the nominal value for the nominal speed - interval = ticks_nominal; - - // Ensure this runs at the correct step rate, even if it just came off an acceleration - step_loops = step_loops_nominal; - } - // If current block is finished, reset pointer - if (all_steps_done) { + if (step_events_completed >= step_event_count) { axis_did_move = 0; current_block = NULL; planner.discard_current_block(); } + else { + // Step events not completed yet... + + // Are we in acceleration phase ? + if (step_events_completed <= accelerate_until) { // Calculate new timer value + + #if ENABLED(S_CURVE_ACCELERATION) + // Get the next speed to use (Jerk limited!) + uint32_t acc_step_rate = + acceleration_time < current_block->acceleration_time + ? _eval_bezier_curve(acceleration_time) + : current_block->cruise_rate; + #else + acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; + NOMORE(acc_step_rate, current_block->nominal_rate); + #endif + + // acc_step_rate is in steps/second + + // step_rate to timer interval and steps per stepper isr + interval = calc_timer_interval(acc_step_rate, oversampling_factor, &steps_per_isr); + acceleration_time += interval; + + #if ENABLED(LIN_ADVANCE) + if (LA_use_advance_lead) { + // Wake up eISR on first acceleration loop and fire ISR if final adv_rate is reached + if (step_events_completed == steps_per_isr || (LA_steps && LA_isr_rate != current_block->advance_speed)) { + nextAdvanceISR = 0; + LA_isr_rate = current_block->advance_speed; + } + } + else { + LA_isr_rate = LA_ADV_NEVER; + if (LA_steps) nextAdvanceISR = 0; + } + #endif // LIN_ADVANCE + } + // Are we in Deceleration phase ? + else if (step_events_completed > decelerate_after) { + uint32_t step_rate; + + #if ENABLED(S_CURVE_ACCELERATION) + // If this is the 1st time we process the 2nd half of the trapezoid... + if (!bezier_2nd_half) { + // Initialize the Bézier speed curve + _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); + bezier_2nd_half = true; + // The first point starts at cruise rate. Just save evaluation of the Bézier curve + step_rate = current_block->cruise_rate; + } + else { + // Calculate the next speed to use + step_rate = deceleration_time < current_block->deceleration_time + ? _eval_bezier_curve(deceleration_time) + : current_block->final_rate; + } + #else + + // Using the old trapezoidal control + step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); + if (step_rate < acc_step_rate) { // Still decelerating? + step_rate = acc_step_rate - step_rate; + NOLESS(step_rate, current_block->final_rate); + } + else + step_rate = current_block->final_rate; + #endif + + // step_rate is in steps/second + + // step_rate to timer interval and steps per stepper isr + interval = calc_timer_interval(step_rate, oversampling_factor, &steps_per_isr); + deceleration_time += interval; + + #if ENABLED(LIN_ADVANCE) + if (LA_use_advance_lead) { + if (step_events_completed <= decelerate_after + steps_per_isr || + (LA_steps && LA_isr_rate != current_block->advance_speed) + ) { + nextAdvanceISR = 0; // Wake up eISR on first deceleration loop + LA_isr_rate = current_block->advance_speed; + } + } + else { + LA_isr_rate = LA_ADV_NEVER; + if (LA_steps) nextAdvanceISR = 0; + } + #endif // LIN_ADVANCE + } + // We must be in cruise phase otherwise + else { + + #if ENABLED(LIN_ADVANCE) + // If there are any esteps, fire the next advance_isr "now" + if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; + #endif + + // Calculate the ticks_nominal for this nominal speed, if not done yet + if (ticks_nominal < 0) { + // step_rate to timer interval and loops for the nominal speed + ticks_nominal = calc_timer_interval(current_block->nominal_rate, oversampling_factor, &steps_per_isr); + } + + // The timer interval is just the nominal value for the nominal speed + interval = ticks_nominal; + } + } } // If there is no current block at this point, attempt to pop one from the buffer @@ -1697,25 +1655,82 @@ uint32_t Stepper::stepper_block_phase_isr() { //if (!!current_block->steps[C_AXIS]) SBI(axis_bits, Z_HEAD); axis_did_move = axis_bits; + // No acceleration / deceleration time elapsed so far + acceleration_time = deceleration_time = 0; + + uint8_t oversampling = 0; // Assume we won't use it + #if ENABLED(ADAPTIVE_STEP_SMOOTHING) + // At this point, we must decide if we can use Stepper movement axis smoothing. + uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) + while (max_rate < MIN_STEP_ISR_FREQUENCY) { + max_rate <<= 1; + if (max_rate >= MAX_1X_STEP_ISR_FREQUENCY) break; + ++oversampling; + } + oversampling_factor = oversampling; + #endif + + // Based on the oversampling factor, do the calculations + step_event_count = current_block->step_event_count << oversampling; + + // Initialize Bresenham delta errors to 1/2 + delta_error[X_AXIS] = delta_error[Y_AXIS] = delta_error[Z_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); + + // Calculate Bresenham dividends + advance_dividend[X_AXIS] = current_block->steps[X_AXIS] << 1; + advance_dividend[Y_AXIS] = current_block->steps[Y_AXIS] << 1; + advance_dividend[Z_AXIS] = current_block->steps[Z_AXIS] << 1; + advance_dividend[E_AXIS] = current_block->steps[E_AXIS] << 1; + + // Calculate Bresenham divisor + advance_divisor = step_event_count << 1; + + // No step events completed so far + step_events_completed = 0; + + // Compute the acceleration and deceleration points + accelerate_until = current_block->accelerate_until << oversampling; + decelerate_after = current_block->decelerate_after << oversampling; + + #if ENABLED(MIXING_EXTRUDER) + const uint32_t e_steps = ( + #if ENABLED(LIN_ADVANCE) + current_block->steps[E_AXIS] + #else + step_event_count + #endif + ); + MIXING_STEPPERS_LOOP(i) { + delta_error_m[i] = -int32_t(e_steps); + advance_dividend_m[i] = current_block->mix_steps[i] << 1; + } + advance_divisor_m = e_steps << 1; + #else + active_extruder = current_block->active_extruder; + #endif + // Initialize the trapezoid generator from the current block. #if ENABLED(LIN_ADVANCE) - #if E_STEPPERS > 1 - if (current_block->active_extruder != last_movement_extruder) { - current_adv_steps = 0; // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - LA_active_extruder = current_block->active_extruder; - } + #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 + // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. + if (active_extruder != last_moved_extruder) LA_current_adv_steps = 0; #endif - if ((use_advance_lead = current_block->use_advance_lead)) { - LA_decelerate_after = current_block->decelerate_after; - final_adv_steps = current_block->final_adv_steps; - max_adv_steps = current_block->max_adv_steps; + if ((LA_use_advance_lead = current_block->use_advance_lead)) { + LA_final_adv_steps = current_block->final_adv_steps; + LA_max_adv_steps = current_block->max_adv_steps; } #endif - if (current_block->direction_bits != last_direction_bits || current_block->active_extruder != last_movement_extruder) { + if (current_block->direction_bits != last_direction_bits + #if DISABLED(MIXING_EXTRUDER) + || active_extruder != last_moved_extruder + #endif + ) { last_direction_bits = current_block->direction_bits; - last_movement_extruder = current_block->active_extruder; + #if DISABLED(MIXING_EXTRUDER) + last_moved_extruder = active_extruder; + #endif set_directions(); } @@ -1728,17 +1743,15 @@ uint32_t Stepper::stepper_block_phase_isr() { // on the next call to this ISR, will be discarded. endstops.check_possible_change(); - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; + #if ENABLED(Z_LATE_ENABLE) + // If delayed Z enable, enable it now. This option will severely interfere with + // timing between pulses when chaining motion between blocks, and it could lead + // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! + if (current_block->steps[Z_AXIS]) enable_Z(); + #endif - // No step events completed so far - step_events_completed = 0; - - // step_rate to timer interval for the nominal speed - ticks_nominal = calc_timer_interval(current_block->nominal_rate); - - // make a note of the number of step loops required at nominal speed - step_loops_nominal = step_loops; + // Mark the time_nominal as not calculated yet + ticks_nominal = -1; #if DISABLED(S_CURVE_ACCELERATION) // Set as deceleration point the initial rate of the block @@ -1748,24 +1761,12 @@ uint32_t Stepper::stepper_block_phase_isr() { #if ENABLED(S_CURVE_ACCELERATION) // Initialize the Bézier speed curve _calc_bezier_curve_coeffs(current_block->initial_rate, current_block->cruise_rate, current_block->acceleration_time_inverse); - - // We have not started the 2nd half of the trapezoid + // We haven't started the 2nd half of the trapezoid bezier_2nd_half = false; #endif - // Initialize Bresenham counters to 1/2 the ceiling, with proper roundup (as explained in the article linked above) - counter_X = counter_Y = counter_Z = counter_E = -int32_t((current_block->step_event_count + 1) >> 1); - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(i) - counter_m[i] = -int32_t((current_block->mix_event_count[i] + 1) >> 1); - #endif - - #if ENABLED(Z_LATE_ENABLE) - // If delayed Z enable, enable it now. This option will severely interfere with - // timing between pulses when chaining motion between blocks, and it could lead - // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! - if (current_block->steps[Z_AXIS]) enable_Z(); - #endif + // Calculate the initial timer interval + interval = calc_timer_interval(current_block->initial_rate, oversampling_factor, &steps_per_isr); } } @@ -1775,65 +1776,85 @@ uint32_t Stepper::stepper_block_phase_isr() { #if ENABLED(LIN_ADVANCE) - #define CYCLES_EATEN_E (E_STEPPERS * 5) - #define EXTRA_CYCLES_E (STEP_PULSE_CYCLES - (CYCLES_EATEN_E)) - - // Timer interrupt for E. e_steps is set in the main routine; + // Timer interrupt for E. LA_steps is set in the main routine uint32_t Stepper::advance_isr() { uint32_t interval; - if (use_advance_lead) { - if (step_events_completed > LA_decelerate_after && current_adv_steps > final_adv_steps) { - e_steps--; - current_adv_steps--; - interval = eISR_Rate; + if (LA_use_advance_lead) { + if (step_events_completed > decelerate_after && LA_current_adv_steps > LA_final_adv_steps) { + LA_steps--; + LA_current_adv_steps--; + interval = LA_isr_rate; } - else if (step_events_completed < LA_decelerate_after && current_adv_steps < max_adv_steps) { - //step_events_completed <= (uint32_t)current_block->accelerate_until) { - e_steps++; - current_adv_steps++; - interval = eISR_Rate; + else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { + //step_events_completed <= (uint32_t)accelerate_until) { + LA_steps++; + LA_current_adv_steps++; + interval = LA_isr_rate; } else - interval = eISR_Rate = ADV_NEVER; + interval = LA_isr_rate = LA_ADV_NEVER; } else - interval = ADV_NEVER; + interval = LA_ADV_NEVER; - if (e_steps >= 0) - NORM_E_DIR(LA_active_extruder); - else - REV_E_DIR(LA_active_extruder); + #if ENABLED(MIXING_EXTRUDER) + if (LA_steps >= 0) + MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); + else + MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); + #else + if (LA_steps >= 0) + NORM_E_DIR(active_extruder); + else + REV_E_DIR(active_extruder); + #endif // Step E stepper if we have steps - while (e_steps) { + while (LA_steps) { - #if EXTRA_CYCLES_E > 20 - hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM); + #if MINIMUM_STEPPER_PULSE + hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t((HAL_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)); #endif - E_STEP_WRITE(LA_active_extruder, !INVERT_E_STEP_PIN); - - // For minimum pulse time wait before stopping pulses - #if EXTRA_CYCLES_E > 20 - while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM); - #elif EXTRA_CYCLES_E > 0 - DELAY_NS(EXTRA_CYCLES_E * NANOSECONDS_PER_CYCLE); + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) { + // Step mixing steppers (proportionally) + delta_error_m[j] += advance_dividend_m[j]; + // Step when the counter goes over zero + if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); + } + #else + E_STEP_WRITE(active_extruder, !INVERT_E_STEP_PIN); #endif - e_steps < 0 ? ++e_steps : --e_steps; - - E_STEP_WRITE(LA_active_extruder, INVERT_E_STEP_PIN); - - // For minimum pulse time wait before looping - #if EXTRA_CYCLES_E > 20 - if (e_steps) while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - #elif EXTRA_CYCLES_E > 0 - if (e_steps) DELAY_NS(EXTRA_CYCLES_E * NANOSECONDS_PER_CYCLE); + #if MINIMUM_STEPPER_PULSE + // Just wait for the requested pulse duration + while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + // Add to the value, the value needed for the pulse end and ensuring the maximum driver rate is enforced + pulse_end += hal_timer_t(MIN_STEPPER_PULSE_CYCLES) - hal_timer_t((HAL_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)); #endif - } // e_steps + LA_steps < 0 ? ++LA_steps : --LA_steps; + + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) { + if (delta_error_m[j] >= 0) { + delta_error_m[j] -= advance_divisor_m; + E_STEP_WRITE(j, INVERT_E_STEP_PIN); + } + } + #else + E_STEP_WRITE(active_extruder, INVERT_E_STEP_PIN); + #endif + + #if MINIMUM_STEPPER_PULSE + // For minimum pulse time wait before looping + // Just wait for the requested pulse duration + if (LA_steps) while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + #endif + + } // LA_steps return interval; } @@ -2145,6 +2166,12 @@ void Stepper::report_positions() { #if ENABLED(BABYSTEPPING) + #if MINIMUM_STEPPER_PULSE + #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) + #else + #define STEP_PULSE_CYCLES 0 + #endif + #if ENABLED(DELTA) #define CYCLES_EATEN_BABYSTEP (2 * 15) #else @@ -2158,8 +2185,8 @@ void Stepper::report_positions() { #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) #if EXTRA_CYCLES_BABYSTEP > 20 - #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(STEP_TIMER_NUM) - #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } + #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM) + #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } #else #define _SAVE_START NOOP #if EXTRA_CYCLES_BABYSTEP > 0 diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 951847d54f0..427b97f80a5 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -76,10 +76,14 @@ class Stepper { private: static uint8_t last_direction_bits, // The next stepping-bits to be output - last_movement_extruder, // Last movement extruder, as computed when the last movement was fetched from planner axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner + static bool abort_current_block; // Signals to the stepper that current block should be aborted + #if DISABLED(MIXING_EXTRUDER) + static uint8_t last_moved_extruder; // Last-moved extruder, as set when the last movement was fetched from planner + #endif + #if ENABLED(X_DUAL_ENDSTOPS) static bool locked_X_motor, locked_X2_motor; #endif @@ -90,9 +94,34 @@ class Stepper { static bool locked_Z_motor, locked_Z2_motor; #endif - // Counter variables for the Bresenham line tracer - static int32_t counter_X, counter_Y, counter_Z, counter_E; - static uint32_t step_events_completed; // The number of step events executed in the current block + static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks + static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call + + #if ENABLED(ADAPTIVE_STEP_SMOOTHING) + static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis + #else + static constexpr uint8_t oversampling_factor = 0; + #endif + + // Delta error variables for the Bresenham line tracer + static int32_t delta_error[XYZE]; + static uint32_t advance_dividend[XYZE], + advance_divisor, + step_events_completed, // The number of step events executed in the current block + accelerate_until, // The point from where we need to stop acceleration + decelerate_after, // The point from where we need to start decelerating + step_event_count; // The total event count for the current block + + // Mixing extruder mix delta_errors for bresenham tracing + #if ENABLED(MIXING_EXTRUDER) + static int32_t delta_error_m[MIXING_STEPPERS]; + static uint32_t advance_dividend_m[MIXING_STEPPERS], + advance_divisor_m; + #define MIXING_STEPPERS_LOOP(VAR) \ + for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) + #else + static int8_t active_extruder; // Active extruder + #endif #if ENABLED(S_CURVE_ACCELERATION) static int32_t bezier_A, // A coefficient in Bézier speed curve @@ -107,33 +136,19 @@ class Stepper { #endif static uint32_t nextMainISR; // time remaining for the next Step ISR - static bool all_steps_done; // all steps done - #if ENABLED(LIN_ADVANCE) - - static uint32_t LA_decelerate_after; // Copy from current executed block. Needed because current_block is set to NULL "too early". - static uint32_t nextAdvanceISR, eISR_Rate; - 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". - static int8_t e_steps; - static bool use_advance_lead; - #if E_STEPPERS > 1 - static int8_t LA_active_extruder; // Copy from current executed block. Needed because current_block is set to NULL "too early". - #else - static constexpr int8_t LA_active_extruder = 0; - #endif - + static uint32_t nextAdvanceISR, LA_isr_rate; + 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". + static int8_t LA_steps; + static bool LA_use_advance_lead; #endif // LIN_ADVANCE - static uint32_t acceleration_time, deceleration_time; - static uint8_t step_loops, step_loops_nominal; - - static uint32_t ticks_nominal; + static int32_t ticks_nominal; #if DISABLED(S_CURVE_ACCELERATION) static uint32_t acc_step_rate; // needed for deceleration start point #endif static volatile int32_t endstops_trigsteps[XYZ]; - static volatile int32_t endstops_stepsTotal, endstops_stepsDone; // // Positions of stepper motors, in step units @@ -145,16 +160,6 @@ class Stepper { // static int8_t count_direction[NUM_AXIS]; - // - // Mixing extruder mix counters - // - #if ENABLED(MIXING_EXTRUDER) - static int32_t counter_m[MIXING_STEPPERS]; - #define MIXING_STEPPERS_LOOP(VAR) \ - for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) \ - if (current_block->mix_event_count[VAR]) - #endif - public: // @@ -201,7 +206,15 @@ class Stepper { FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } // The extruder associated to the last movement - FORCE_INLINE static uint8_t movement_extruder() { return last_movement_extruder; } + FORCE_INLINE static uint8_t movement_extruder() { + return + #if ENABLED(MIXING_EXTRUDER) + 0 + #else + last_moved_extruder + #endif + ; + } // Handle a triggered endstop static void endstop_triggered(const AxisEnum axis); @@ -279,34 +292,42 @@ class Stepper { // Set direction bits for all steppers static void set_directions(); - // Limit the speed to 10KHz for AVR - #ifndef STEP_DOUBLER_FREQUENCY - #define STEP_DOUBLER_FREQUENCY 10000 - #endif - - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate) { + FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { uint32_t timer; - NOMORE(step_rate, uint32_t(MAX_STEP_FREQUENCY)); + // Scale the frequency, as requested by the caller + step_rate <<= scale; + uint8_t multistep = 1; #if DISABLED(DISABLE_MULTI_STEPPING) - if (step_rate > STEP_DOUBLER_FREQUENCY * 2) { // If steprate > (STEP_DOUBLER_FREQUENCY * 2) kHz >> step 4 times - step_rate >>= 2; - step_loops = 4; - } - else if (step_rate > STEP_DOUBLER_FREQUENCY) { // If steprate > STEP_DOUBLER_FREQUENCY kHz >> step 2 times + + // The stepping frequency limits for each multistepping rate + static const uint32_t limit[] PROGMEM = { + ( MAX_1X_STEP_ISR_FREQUENCY ), + ( MAX_2X_STEP_ISR_FREQUENCY >> 1), + ( MAX_4X_STEP_ISR_FREQUENCY >> 2), + ( MAX_8X_STEP_ISR_FREQUENCY >> 3), + ( MAX_16X_STEP_ISR_FREQUENCY >> 4), + ( MAX_32X_STEP_ISR_FREQUENCY >> 5), + ( MAX_64X_STEP_ISR_FREQUENCY >> 6), + (MAX_128X_STEP_ISR_FREQUENCY >> 7) + }; + + // Select the proper multistepping + uint8_t idx = 0; + while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) { step_rate >>= 1; - step_loops = 2; - } - else + multistep <<= 1; + ++idx; + }; + #else + NOMORE(step_rate, uint32_t(MAX_1X_STEP_ISR_FREQUENCY)); #endif - step_loops = 1; + *loops = multistep; #ifdef CPU_32_BIT // In case of high-performance processor, it is able to calculate in real-time - const uint32_t min_time_per_step = (HAL_STEPPER_TIMER_RATE) / ((STEP_DOUBLER_FREQUENCY) * 2); timer = uint32_t(HAL_STEPPER_TIMER_RATE) / step_rate; - NOLESS(timer, min_time_per_step); // (STEP_DOUBLER_FREQUENCY * 2 kHz - this should never happen) #else constexpr uint32_t min_step_rate = F_CPU / 500000U; NOLESS(step_rate, min_step_rate); @@ -324,10 +345,8 @@ class Stepper { timer = (uint16_t)pgm_read_word_near(table_address) - (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3); } - if (timer < 100) { // (20kHz - this should never happen) - timer = 100; - SERIAL_ECHOLNPAIR(MSG_STEPPER_TOO_HIGH, step_rate); - } + // (there is no need to limit the timer value here. All limits have been + // applied above, and AVR is able to keep up at 30khz Stepping ISR rate) #endif return timer; diff --git a/docs/Bresenham.md b/docs/Bresenham.md new file mode 100644 index 00000000000..59a21509649 --- /dev/null +++ b/docs/Bresenham.md @@ -0,0 +1,269 @@ +On the Bresenham algorithm as implemented by Marlin: +(Taken from (https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html) + +The basic Bresenham algorithm: + +Consider drawing a line on a raster grid where we restrict the allowable slopes of the line to the range 0 <= m <= 1 + +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: + +- It may plot the point (x+1,y), or: +- It may plot the point (x+1,y+1). + +So, working in the first positive octant of the plane, line drawing becomes a matter of deciding between two possibilities at each step. + +We can draw a diagram of the situation which the plotting program finds itself in having plotted (x,y). + +``` + y+1 +--------------* + | / + | / + | / + | / + | y+e+m*--------+- + | /| ^ | + | / | |m | + | / | | | + | / | v | + | y+e*----|----- |m+ε + | /| | ^ | + | / | | |ε | + | / | | | | + |/ | | v v + y *----+----+----------+-- + x x+1 +``` + +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. + +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 + +``` +y + ε + m < y + 0.5 +``` + +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. + +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. + +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: + +``` +ε[new] = (y + ε + m) - y +``` + +Otherwise, it is: + +``` +ε[new] = (y + ε + m) - (y + 1) +``` + +This gives an algorithm for a DDA which avoids rounding operations, instead using the error variable ε to control plotting: + +``` + ε = 0, y = y[1] + for x = x1 to x2 do + Plot point at (x,y) + if (ε + m < 0.5) + ε = ε + m + else + y = y + 1, ε = ε + m - 1 + endif + endfor +``` + +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: + +``` + ε + m < 0.5 + ε + Δy/Δx < 0.5 +2.ε.Δx + 2.Δy < Δx +``` + +All quantities in this inequality are now integral. + +Substitute ε' for ε.Δx . The test becomes: + +``` +2.(ε' + Δy) < Δx +``` + +This gives an integer-only test for deciding which point to plot. + +The update rules for the error on each step may also be cast into ε' form. Consider the floating-point versions of the update rules: + +``` +ε = ε + m +ε = ε + m - 1 +``` + + Multiplying through by Δx yields: + +``` +ε.Δx = ε.Δx + Δy +ε.Δx = ε.Δx + Δy - Δx +``` + +Which is in ε' form: + +``` +ε' = ε' + Δy +ε' = ε' + Δy - Δx +``` + +Using this new ``error'' value, ε' with the new test and update equations gives Bresenham's integer-only line drawing algorithm: + +``` +ε' = 0, y = y[1] +for x = x1 to x2 do + Plot point at (x,y) + if (2.(ε' + Δy) < Δx) + ε' = ε' + Δy + else + y = y + 1, ε' = ε' + Δy - Δx + endif +endfor +``` + +It is a Integer only algorithm - hence efficient (fast). And the Multiplication by 2 can be implemented by left-shift. 0 <= m <= 1 + +### Oversampling Bresenham algorithm: + +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) + +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. + +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. + +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. + +It is nearly trivial to extend Bresenham to "oversample" in that situation: Let's do it: + +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. + +Let's call 'r' the count of subdivisions we want to split an integer increment of the X axis: + +``` +m = Δy/Δx = increment of y due to the increment of x1 +``` + +Every time we move `1/r` in the X axis, then the Y axis should move `m.1/r` + +But, as stated previously, due to the resolution of the screen, there are 2 choices: + +- It may plot the point `(x+(1/r),y)`, or: +- It may plot the point `(x+(1/r),y+1)`. + +That decision must be made keeping the error as small as possible: + +``` +-0.5 < ε < 0.5 +``` + +So, the proper condition for that decision is (`m/r` is the increment of y due to the fractional `1/r` increment of `x`): + +``` +y + ε + m/r < y + 0.5 +ε + m/r < 0.5 [1] +``` + +Once we did the decision, then the error update conditions are: + +Decision A: +``` +ε[new] = y + ε + m/r - y +ε[new] = ε + m/r [2] +``` + +Decision B: +``` +ε[new] = y + ε + m/r - (y+1) +ε[new] = ε + m/r - 1 [3] +``` + +We replace m in the decision inequality [1] by its definition: + +``` +ε + m/r < 0.5 +ε + ΔY/(ΔX*r) < 0.5 +``` + +Then, we multiply it by `2.Δx.r`: + +``` +ε + ΔY/(ΔX*r) < 0.5 +2.ΔX.ε.r + 2.ΔY < ΔX.r +``` + +If we define `ε' = 2.ε.ΔX.r` then it becomes: + +``` +ε' + 2.ΔY < ΔX.r [4] +``` + +Now, for the update rules, we multiply by 2.r.ΔX + +``` +ε[new] = ε + m/r +2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.r.ΔX.ΔY/ΔX/r +2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.ΔY +ε'[new] = ε' + 2.ΔY [6] +``` + +``` +ε[new] = ε + m/r - 1 +2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.r.ΔX.ΔY/ΔX/r - 1 . 2.r.ΔX +2.r.ΔX.ε[new] = 2.r.ΔX.ε + 2.ΔY - 2.ΔX.r +ε'[new] = ε' + 2.ΔY - 2.ΔX.r [7] +``` + +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. + +Summarizing: + +``` +Condition equation: + + ε' + 2.ΔY < ΔX.r [4] + +Error update equations: + + ε'[new] = ε' + 2.ΔY [6] + + ε'[new] = ε' + 2.ΔY - 2.ΔX.r [7] +``` + +This can be implemented in C as: + +```cpp + class OversampledBresenham { + private: + long divisor, // stepsX + dividend, // stepsY + advanceDivisor, // advanceX + advanceDividend; // advanceY + int errorAccumulator; // Error accumulator + + public: + unsigned int ticker; + + OversampledBresenhan(const long& inDividend, const long& inDivisor, int rate) { + ticker = 0; + divisor = inDivisor; + dividend = inDividend; + advanceDivisor = divisor * 2 * rate; + advanceDividend = dividend * 2; + errorAccumulator = -divisor * rate; + } + + bool tick() { + errorAccumulator += advanceDividend; + const bool over = errorAccumulator >= 0; + if (over) { + ticker++; + errorAccumulator -= advanceDivisor; + } + return over; + } + }; +```