From af4ba2b1ced98066b89dde7636b052b075f96621 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 5 May 2023 17:42:56 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Minor=20Fixed-Time=20Motion=20pa?= =?UTF-8?q?tches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 5 +++++ Marlin/src/inc/SanityCheck.h | 7 +++++++ Marlin/src/module/ft_motion.cpp | 3 --- Marlin/src/module/stepper.cpp | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 5b4d33609de5..5000f3673ba0 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1624,6 +1624,11 @@ void setup() { SETUP_RUN(bdl.init(I2C_BD_SDA_PIN, I2C_BD_SCL_PIN, I2C_BD_DELAY)); #endif + + #if ENABLED(FT_MOTION) + SETUP_RUN(fxdTiCtrl.init()); + #endif + marlin_state = MF_RUNNING; #ifdef STARTUP_TUNE diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 223baf928dcf..e495d7a11582 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4030,6 +4030,13 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif #endif +/** + * Fixed-Time Motion limitations + */ +#if ENABLED(FT_MOTION) && (NUM_AXES > 3 || E_STEPPERS > 1 || NUM_Z_STEPPERS > 1 || ANY(DUAL_X_CARRIAGE, HAS_DUAL_X_STEPPERS, HAS_DUAL_Y_STEPPERS, HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)) + #error "FT_MOTION is currently limited to machines with 3 linear axes and a single extruder." +#endif + // Multi-Stepping Limit static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING_LIMIT), "MULTISTEPPING_LIMIT must be 1, 2, 4, 8, 16, 32, 64, or 128."); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 2fe38025296d..bc6ba8d3e364 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -211,9 +211,6 @@ void FxdTiCtrl::loop() { if (!cfg_mode) return; - static bool initd = false; - if (!initd) { init(); initd = true; } - // Handle block abort with the following sequence: // 1. Zero out commands in stepper ISR. // 2. Drain the motion buffer, stop processing until they are emptied. diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 140a539ef36c..c7c053679a70 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3466,7 +3466,7 @@ void Stepper::report_positions() { #if HAS_Z_AXIS // Update step counts - if (z_step) count_position.z += z_dir ? -1 : 1; + if (z_step) count_position.z += z_dir ? 1 : -1; #endif AWAIT_HIGH_PULSE();