Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FT_MOTION: Disable FT-MOTION for homing and probing for Biqu Microprobe #27368

Open
wants to merge 14 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@
* 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
Expand Down
15 changes: 15 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,21 @@ G29_parameters_t unified_bed_leveling::param;

void unified_bed_leveling::G29() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

bool probe_deployed = false;
if (G29_parse_parameters()) return; // Abort on parameter error

Expand Down
19 changes: 19 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"

#if ENABLED(FT_MOTION)
#include "../../../module/ft_motion.h"
#endif

#if ABL_USES_GRID
#if ENABLED(PROBE_Y_FIRST)
#define PR_OUTER_VAR abl.meshCount.x
Expand Down Expand Up @@ -230,6 +234,21 @@ class G29_State {
*/
G29_TYPE GcodeSuite::G29() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

DEBUG_SECTION(log_G29, "G29", DEBUGGING(LEVELING));

// Leveling state is persistent when done manually with multiple G29 commands
Expand Down
19 changes: 19 additions & 0 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"

#if ENABLED(FT_MOTION)
#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."); }

Expand All @@ -63,6 +67,21 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM("
*/
void GcodeSuite::G29() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

DEBUG_SECTION(log_G29, "G29", true);

// G29 Q is also available if debugging
Expand Down
36 changes: 36 additions & 0 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#include "../../feature/bltouch.h"
#endif

#if ENABLED(FT_MOTION)
#include "../../module/ft_motion.h"
#endif

#include "../../lcd/marlinui.h"

#if ENABLED(EXTENSIBLE_UI)
Expand Down Expand Up @@ -129,6 +133,22 @@
#if ENABLED(Z_SAFE_HOMING)

inline void home_z_safely() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING));

// Disallow Z homing if X or Y homing is needed
Expand Down Expand Up @@ -218,6 +238,22 @@
* Z Home to the Z endstop
*/
void GcodeSuite::G28() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

DEBUG_SECTION(log_G28, "G28", DEBUGGING(LEVELING));
if (DEBUGGING(LEVELING)) log_machine_info();

Expand Down
19 changes: 19 additions & 0 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include "../../feature/probe_temp_comp.h"
#endif

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
#include "../../module/ft_motion.h"
#endif

#if ANY(DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
#define VERBOSE_SINGLE_PROBE
#endif
Expand All @@ -50,6 +54,21 @@
*/
void GcodeSuite::G30() {

#if ENABLED(FT_MOTION) && ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
// Disable Fixed-Time Motion for probing
struct OnExit {
bool isactive;
OnExit() {
isactive = ftMotion.cfg.active;
ftMotion.cfg.active = false;
}
~OnExit() {
ftMotion.cfg.active = isactive;
ftMotion.init();
}
} on_exit;
#endif

xy_pos_t probepos = current_position;

const bool seenX = parser.seenval('X');
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1403,10 +1403,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
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/module/ft_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down