diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 63b39db04c4a..fd6a7f9f5bd2 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3174,7 +3174,7 @@ * * It is recommended to set HOMING_BUMP_MM to { 0, 0, 0 }. * - * SPI_ENDSTOPS *** Beta feature! *** TMC2130/TMC5160 Only *** + * SPI_ENDSTOPS *** TMC2130/TMC5160 Only *** * Poll the driver through SPI to determine load when homing. * Removes the need for a wire from DIAG1 to an endstop pin. * @@ -3202,7 +3202,7 @@ //#define U_STALL_SENSITIVITY 8 //#define V_STALL_SENSITIVITY 8 //#define W_STALL_SENSITIVITY 8 - //#define SPI_ENDSTOPS // TMC2130 only + //#define SPI_ENDSTOPS // TMC2130/TMC5160 only //#define IMPROVE_HOMING_RELIABILITY #endif @@ -3221,10 +3221,9 @@ //#define TMC_HOME_PHASE { 896, 896, 896 } /** - * Beta feature! - * Create a 50/50 square wave step pulse optimal for stepper drivers. + * Step on both rising and falling edge signals (as with a square wave). */ - //#define SQUARE_WAVE_STEPPING + //#define EDGE_STEPPING /** * Enable M122 debugging command for TMC stepper drivers. diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index cd4c4efee2db..c1e9b2944487 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -678,6 +678,8 @@ #error "INVERT_*_STEP_PIN true is now STEP_STATE_* LOW, and INVERT_*_STEP_PIN false is now STEP_STATE_* HIGH." #elif defined(PROBE_PT_1_X) || defined(PROBE_PT_1_Y) || defined(PROBE_PT_2_X) || defined(PROBE_PT_2_Y) || defined(PROBE_PT_3_X) || defined(PROBE_PT_3_Y) #error "PROBE_PT_[123]_[XY] is now defined using PROBE_PT_[123] with an array { x, y }." +#elif defined(SQUARE_WAVE_STEPPING) + #error "SQUARE_WAVE_STEPPING is now EDGE_STEPPING." #endif // L64xx stepper drivers have been removed diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index 48ce020d3dca..7d87e5953f2f 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -227,7 +227,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); @@ -262,7 +262,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); @@ -684,7 +684,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); @@ -726,7 +726,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); @@ -766,7 +766,7 @@ enum StealthIndex : uint8_t { st.sdoff(0); st.rms_current(mA); st.microsteps(microsteps); - TERN_(SQUARE_WAVE_STEPPING, st.dedge(true)); + TERN_(EDGE_STEPPING, st.dedge(true)); st.intpol(interpolate); st.diss2g(true); // Disable short to ground protection. Too many false readings? TERN_(TMC_DEBUG, st.rdsel(0b01)); @@ -784,7 +784,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); @@ -819,7 +819,7 @@ enum StealthIndex : uint8_t { chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; - TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); + TERN_(EDGE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, hold_multiplier); diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 95bab7652c1a..3705543c9904 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -115,7 +115,7 @@ void restore_trinamic_drivers(); void reset_trinamic_drivers(); -#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING)) +#define AXIS_HAS_DEDGE(A) (AXIS_IS_TMC(A) && ENABLED(EDGE_STEPPING)) // X Stepper #if AXIS_IS_TMC(X) @@ -126,7 +126,7 @@ void reset_trinamic_drivers(); #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing_X.toff : 0) #define X_ENABLE_READ() stepperX.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(X) + #if AXIS_HAS_DEDGE(X) #define X_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X_STEP_PIN); }while(0) #endif #endif @@ -140,7 +140,7 @@ void reset_trinamic_drivers(); #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y.toff : 0) #define Y_ENABLE_READ() stepperY.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Y) + #if AXIS_HAS_DEDGE(Y) #define Y_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y_STEP_PIN); }while(0) #endif #endif @@ -154,7 +154,7 @@ void reset_trinamic_drivers(); #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z.toff : 0) #define Z_ENABLE_READ() stepperZ.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Z) + #if AXIS_HAS_DEDGE(Z) #define Z_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z_STEP_PIN); }while(0) #endif #endif @@ -171,7 +171,7 @@ void reset_trinamic_drivers(); #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing_X2.toff : 0) #define X2_ENABLE_READ() stepperX2.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(X2) + #if AXIS_HAS_DEDGE(X2) #define X2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X2_STEP_PIN); }while(0) #endif #endif @@ -188,7 +188,7 @@ void reset_trinamic_drivers(); #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y2.toff : 0) #define Y2_ENABLE_READ() stepperY2.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Y2) + #if AXIS_HAS_DEDGE(Y2) #define Y2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y2_STEP_PIN); }while(0) #endif #endif @@ -205,7 +205,7 @@ void reset_trinamic_drivers(); #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z2.toff : 0) #define Z2_ENABLE_READ() stepperZ2.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Z2) + #if AXIS_HAS_DEDGE(Z2) #define Z2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z2_STEP_PIN); }while(0) #endif #endif @@ -222,7 +222,7 @@ void reset_trinamic_drivers(); #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z3.toff : 0) #define Z3_ENABLE_READ() stepperZ3.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Z3) + #if AXIS_HAS_DEDGE(Z3) #define Z3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z3_STEP_PIN); }while(0) #endif #endif @@ -239,7 +239,7 @@ void reset_trinamic_drivers(); #define Z4_ENABLE_WRITE(STATE) stepperZ4.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z4.toff : 0) #define Z4_ENABLE_READ() stepperZ4.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(Z4) + #if AXIS_HAS_DEDGE(Z4) #define Z4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z4_STEP_PIN); }while(0) #endif #endif @@ -253,7 +253,7 @@ void reset_trinamic_drivers(); #define I_ENABLE_WRITE(STATE) stepperI.toff((STATE)==I_ENABLE_ON ? chopper_timing.toff : 0) #define I_ENABLE_READ() stepperI.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(I) + #if AXIS_HAS_DEDGE(I) #define I_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(I_STEP_PIN); }while(0) #endif #endif @@ -267,7 +267,7 @@ void reset_trinamic_drivers(); #define J_ENABLE_WRITE(STATE) stepperJ.toff((STATE)==J_ENABLE_ON ? chopper_timing.toff : 0) #define J_ENABLE_READ() stepperJ.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(J) + #if AXIS_HAS_DEDGE(J) #define J_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(J_STEP_PIN); }while(0) #endif #endif @@ -281,7 +281,7 @@ void reset_trinamic_drivers(); #define K_ENABLE_WRITE(STATE) stepperK.toff((STATE)==K_ENABLE_ON ? chopper_timing.toff : 0) #define K_ENABLE_READ() stepperK.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(K) + #if AXIS_HAS_DEDGE(K) #define K_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(K_STEP_PIN); }while(0) #endif #endif @@ -295,7 +295,7 @@ void reset_trinamic_drivers(); #define U_ENABLE_WRITE(STATE) stepperU.toff((STATE)==U_ENABLE_ON ? chopper_timing_U.toff : 0) #define U_ENABLE_READ() stepperU.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(U) + #if AXIS_HAS_DEDGE(U) #define U_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(U_STEP_PIN); }while(0) #endif #endif @@ -309,7 +309,7 @@ void reset_trinamic_drivers(); #define V_ENABLE_WRITE(STATE) stepperV.toff((STATE)==V_ENABLE_ON ? chopper_timing_V.toff : 0) #define V_ENABLE_READ() stepperV.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(V) + #if AXIS_HAS_DEDGE(V) #define V_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(V_STEP_PIN); }while(0) #endif #endif @@ -323,7 +323,7 @@ void reset_trinamic_drivers(); #define W_ENABLE_WRITE(STATE) stepperW.toff((STATE)==W_ENABLE_ON ? chopper_timing_W.toff : 0) #define W_ENABLE_READ() stepperW.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(W) + #if AXIS_HAS_DEDGE(W) #define W_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(W_STEP_PIN); }while(0) #endif #endif @@ -340,7 +340,7 @@ void reset_trinamic_drivers(); #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing_E0.toff : 0) #define E0_ENABLE_READ() stepperE0.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E0) + #if AXIS_HAS_DEDGE(E0) #define E0_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E0_STEP_PIN); }while(0) #endif #endif @@ -357,7 +357,7 @@ void reset_trinamic_drivers(); #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing_E1.toff : 0) #define E1_ENABLE_READ() stepperE1.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E1) + #if AXIS_HAS_DEDGE(E1) #define E1_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E1_STEP_PIN); }while(0) #endif #endif @@ -374,7 +374,7 @@ void reset_trinamic_drivers(); #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing_E2.toff : 0) #define E2_ENABLE_READ() stepperE2.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E2) + #if AXIS_HAS_DEDGE(E2) #define E2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E2_STEP_PIN); }while(0) #endif #endif @@ -391,7 +391,7 @@ void reset_trinamic_drivers(); #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing_E3.toff : 0) #define E3_ENABLE_READ() stepperE3.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E3) + #if AXIS_HAS_DEDGE(E3) #define E3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E3_STEP_PIN); }while(0) #endif #endif @@ -408,7 +408,7 @@ void reset_trinamic_drivers(); #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing_E4.toff : 0) #define E4_ENABLE_READ() stepperE4.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E4) + #if AXIS_HAS_DEDGE(E4) #define E4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E4_STEP_PIN); }while(0) #endif #endif @@ -425,7 +425,7 @@ void reset_trinamic_drivers(); #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing_E5.toff : 0) #define E5_ENABLE_READ() stepperE5.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E5) + #if AXIS_HAS_DEDGE(E5) #define E5_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E5_STEP_PIN); }while(0) #endif #endif @@ -442,7 +442,7 @@ void reset_trinamic_drivers(); #define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing_E6.toff : 0) #define E6_ENABLE_READ() stepperE6.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E6) + #if AXIS_HAS_DEDGE(E6) #define E6_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E6_STEP_PIN); }while(0) #endif #endif @@ -459,7 +459,7 @@ void reset_trinamic_drivers(); #define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing_E7.toff : 0) #define E7_ENABLE_READ() stepperE7.isEnabled() #endif - #if AXIS_HAS_SQUARE_WAVE(E7) + #if AXIS_HAS_DEDGE(E7) #define E7_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E7_STEP_PIN); }while(0) #endif #endif diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index f8fce4b5b868..f4f05ceea795 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -64,7 +64,7 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \ X_HARDWARE_SERIAL Serial2 opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \ - STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING + STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING EDGE_STEPPING exec_test $1 $2 "FYSETC_F6 | SCARA | Mixed TMC | EEPROM" "$3" # clean up diff --git a/buildroot/tests/SAMD21_minitronics20 b/buildroot/tests/SAMD21_minitronics20 index b46fb9f08ab3..f4a75afafea7 100755 --- a/buildroot/tests/SAMD21_minitronics20 +++ b/buildroot/tests/SAMD21_minitronics20 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING + EDGE_STEPPING exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3" # clean up diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index 042733072ddc..72996e7b7f3a 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING TMC_DEBUG + EDGE_STEPPING TMC_DEBUG exec_test $1 $2 "Grand Central M4 with assorted features" "$3" # clean up