diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6a4087529dd2..f73ad0560d8a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1511,7 +1511,6 @@ * For information about this sensor https://github.com/bigtreetech/MicroProbe * * Also requires PROBE_ENABLE_DISABLE - * With FT_MOTION requires ENDSTOP_INTERRUPTS_FEATURE */ //#define BIQU_MICROPROBE_V1 // Triggers HIGH //#define BIQU_MICROPROBE_V2 // Triggers LOW diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 2cea4968b785..1d765988ed1d 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -48,6 +48,10 @@ #include "../hilbert_curve.h" #endif +#if FT_MOTION_DISABLE_FOR_PROBING + #include "../../../module/ft_motion.h" +#endif + #include #define UBL_G29_P31 @@ -309,6 +313,10 @@ void unified_bed_leveling::G29() { const uint8_t p_val = parser.byteval('P'); const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen_test('J'); + #if FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing + #endif + // Check for commands that require the printer to be homed if (may_move) { planner.synchronize(); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 386b805b6def..6225c243601e 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -59,6 +59,10 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" +#if DISABLED(PROBE_MANUALLY) && FT_MOTION_DISABLE_FOR_PROBING + #include "../../../module/ft_motion.h" +#endif + #if ABL_USES_GRID #if ENABLED(PROBE_Y_FIRST) #define PR_OUTER_VAR abl.meshCount.x @@ -280,6 +284,10 @@ G29_TYPE GcodeSuite::G29() { // Set and report "probing" state to host TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE, false)); + #if DISABLED(PROBE_MANUALLY) && FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing + #endif + /** * On the initial G29 fetch command parameters. */ diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 6d23de4f77b4..be0e5d7f1806 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -45,6 +45,10 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" +#if FT_MOTION_DISABLE_FOR_PROBING + #include "../../module/ft_motion.h" +#endif + // Save 130 bytes with non-duplication of PSTR inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); } @@ -63,6 +67,10 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" */ void GcodeSuite::G29() { + #if FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing + #endif + DEBUG_SECTION(log_G29, "G29", true); // G29 Q is also available if debugging diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index ac90756ded8d..85d27e14e8c0 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -52,6 +52,10 @@ #include "../../feature/bltouch.h" #endif +#if FT_MOTION_DISABLE_FOR_PROBING + #include "../../module/ft_motion.h" +#endif + #include "../../lcd/marlinui.h" #if ENABLED(EXTENSIBLE_UI) @@ -129,6 +133,11 @@ #if ENABLED(Z_SAFE_HOMING) inline void home_z_safely() { + + #if FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for homing + #endif + DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING)); // Disallow Z homing if X or Y homing is needed @@ -284,6 +293,10 @@ void GcodeSuite::G28() { motion_state_t saved_motion_state = begin_slow_homing(); #endif + #if FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for homing + #endif + // Always home with tool 0 active #if HAS_MULTI_HOTEND #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 29d6c1ad2ba7..aa116f188168 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -34,6 +34,10 @@ #include "../../feature/probe_temp_comp.h" #endif +#if FT_MOTION_DISABLE_FOR_PROBING + #include "../../module/ft_motion.h" +#endif + #if ANY(DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI) #define VERBOSE_SINGLE_PROBE #endif @@ -76,6 +80,10 @@ void GcodeSuite::G30() { // Use 'C' to set Probe Temperature Compensation ON/OFF (on by default) TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true))); + #if FT_MOTION_DISABLE_FOR_PROBING + FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing + #endif + // Probe the bed, optionally raise, and return the measured height const float measured_z = probe.probe_at_point(probepos, raise_after); diff --git a/Marlin/src/inc/Conditionals-4-adv.h b/Marlin/src/inc/Conditionals-4-adv.h index be651206423f..671c3590f416 100644 --- a/Marlin/src/inc/Conditionals-4-adv.h +++ b/Marlin/src/inc/Conditionals-4-adv.h @@ -1423,6 +1423,9 @@ #define FTM_WINDOW_SIZE FTM_BW_SIZE #define FTM_BATCH_SIZE FTM_BW_SIZE #endif + #if ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) + #define FT_MOTION_DISABLE_FOR_PROBING 1 + #endif #endif // Multi-Stepping Limit diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 034878db66d1..be1ab0db50e0 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1452,10 +1452,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "BIQU MicroProbe requires a PROBE_ENABLE_PIN." #endif - #if ENABLED(FT_MOTION) && DISABLED(ENDSTOP_INTERRUPTS_FEATURE) - #error "BIQU Microprobe requires ENDSTOP_INTERRUPTS_FEATURE with FT_MOTION." - #endif - #if ENABLED(BIQU_MICROPROBE_V1) #if ENABLED(INVERTED_PROBE_STATE) #if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 8cfc8f273137..5044814373c5 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -382,8 +382,6 @@ void FTMotion::reset() { steps.reset(); interpIdx = 0; - stepper.axis_did_move.reset(); - #if HAS_FTM_SHAPING TERN_(HAS_X_AXIS, ZERO(shaping.x.d_zi)); TERN_(HAS_Y_AXIS, ZERO(shaping.y.d_zi)); diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index bff3ba1fd423..f6ce81af12ff 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -213,7 +213,18 @@ class FTMotion { FORCE_INLINE static int32_t num_samples_shaper_settle() { return ( shaping.x.ena || shaping.y.ena ) ? FTM_ZMAX : 0; } - }; // class FTMotion extern FTMotion ftMotion; + +typedef struct FTMotionDisableInScope { + bool isactive; + FTMotionDisableInScope() { + isactive = ftMotion.cfg.active; + ftMotion.cfg.active = false; + } + ~FTMotionDisableInScope() { + ftMotion.cfg.active = isactive; + if (isactive) ftMotion.init(); + } +} FTMotionDisableInScope_t; diff --git a/buildroot/tests/STM32F103RC_btt b/buildroot/tests/STM32F103RC_btt index 62ef7d96e5c4..178170455fb0 100755 --- a/buildroot/tests/STM32F103RC_btt +++ b/buildroot/tests/STM32F103RC_btt @@ -12,5 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209 -opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU ADAPTIVE_STEP_SMOOTHING NONLINEAR_EXTRUSION +opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT \ + FT_MOTION FT_MOTION_MENU BIQU_MICROPROBE_V1 PROBE_ENABLE_DISABLE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR \ + ADAPTIVE_STEP_SMOOTHING NONLINEAR_EXTRUSION exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - TMC2209 HW Serial, FT_MOTION" "$3" diff --git a/ini/esp32.ini b/ini/esp32.ini index e60ab815639b..4afaeaa030a6 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -19,7 +19,7 @@ board = esp32dev build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -std=gnu++17 build_unflags = -std=gnu11 -std=gnu++11 build_src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet +lib_ignore = NativeEthernet, AsyncTCP_RP2040W upload_speed = 500000 monitor_speed = 250000 monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder