From 1bbae4676f21217b4555fba2f037b92279a5d14d Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Mon, 3 Jun 2024 08:19:46 -0400 Subject: [PATCH] Speed tweaks --- Marlin/Configuration.h | 18 +++++++++--------- Marlin/Configuration_adv.h | 8 ++++---- Marlin/src/module/stepper.cpp | 3 ++- Marlin/src/module/stepper.h | 10 +++++----- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6f4d3ea6e0..f81b08009b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -139,14 +139,14 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -#define X_DRIVER_TYPE TB6600 -#define Y_DRIVER_TYPE TB6600 -#define Z_DRIVER_TYPE TB6600 +#define X_DRIVER_TYPE TMC5160 +#define Y_DRIVER_TYPE TMC5160 +#define Z_DRIVER_TYPE TMC5160_STANDALONE //#define X2_DRIVER_TYPE A4988 -#define Y2_DRIVER_TYPE TB6600 -#define Z2_DRIVER_TYPE TB6600 -#define Z3_DRIVER_TYPE TB6600 -#define Z4_DRIVER_TYPE TB6600 +#define Y2_DRIVER_TYPE TMC5160 +#define Z2_DRIVER_TYPE TMC5160_STANDALONE +#define Z3_DRIVER_TYPE TMC5160_STANDALONE +#define Z4_DRIVER_TYPE TMC5160_STANDALONE //#define I_DRIVER_TYPE A4988 //#define J_DRIVER_TYPE A4988 //#define K_DRIVER_TYPE A4988 @@ -2369,12 +2369,12 @@ * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ -//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) - //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. //#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build. #endif diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fa894d030d..9b722f70a4 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1386,7 +1386,7 @@ * Multi-stepping sends steps in bursts to reduce MCU usage for high step-rates. * This allows higher feedrates than the MCU could otherwise support. */ -#define MULTISTEPPING_LIMIT 16 //: [1, 2, 4, 8, 16, 32, 64, 128] +#define MULTISTEPPING_LIMIT 32 //: [1, 2, 4, 8, 16, 32, 64, 128] /** * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies @@ -1394,7 +1394,7 @@ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the * lowest stepping frequencies. */ -//#define ADAPTIVE_STEP_SMOOTHING +#define ADAPTIVE_STEP_SMOOTHING /** * Custom Microstepping @@ -2564,7 +2564,7 @@ * * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 10 +//#define MINIMUM_STEPPER_PULSE 5 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -2578,7 +2578,7 @@ * * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 150000 +//#define MAXIMUM_STEPPER_RATE 150000 // @section temperature diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index e9be3d2bf8..14a971c630 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1525,7 +1525,8 @@ void Stepper::apply_directions() { * Directly pulses the stepper motors at high frequency. */ -HAL_STEP_TIMER_ISR() { + + extern "C" [[gnu::section(".ramcode")]] void TIMER0_IRQHandler() { #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) diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 260a6d4d99..7811b27cce 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -478,21 +478,21 @@ class Stepper { } // The ISR scheduler - static void isr(); + FORCE_INLINE static void isr(); // The stepper pulse ISR phase - static void pulse_phase_isr(); + FORCE_INLINE static void pulse_phase_isr(); // The stepper block processing ISR phase - static hal_timer_t block_phase_isr(); + FORCE_INLINE static hal_timer_t block_phase_isr(); #if HAS_ZV_SHAPING - static void shaping_isr(); + FORCE_INLINE static void shaping_isr(); #endif #if ENABLED(LIN_ADVANCE) // The Linear advance ISR phase - static void advance_isr(); + FORCE_INLINE static void advance_isr(); #endif #if ENABLED(BABYSTEPPING)