From b0c007409285d5ede0e5cf14cb4aea1890fb233a Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Sun, 17 Aug 2025 01:21:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Support=20EXTRUDERS=200=20with?= =?UTF-8?q?=20FT=5FMOTION=20(#27984)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/ft_motion.cpp | 14 ++++++++------ Marlin/src/module/ft_motion.h | 2 +- buildroot/tests/rambo | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 5ccc364c1d..1cc90776d6 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -91,7 +91,7 @@ uint32_t FTMotion::interpIdx = 0; // Index of current data point b #if ENABLED(DISTINCT_E_FACTORS) uint8_t FTMotion::block_extruder_axis; // Cached E Axis from last-fetched block -#else +#elif HAS_EXTRUDERS constexpr uint8_t FTMotion::block_extruder_axis; #endif @@ -400,7 +400,7 @@ void FTMotion::reset() { shaping.zi_idx = 0; #endif - TERN_(HAS_EXTRUDERS, e_raw_z1 = e_advanced_z1 = 0.0f); + TERN_(HAS_EXTRUDERS, e_raw_z1 = e_advanced_z1 = 0.0f); // Reset linear advance variables. TERN_(DISTINCT_E_FACTORS, block_extruder_axis = E_AXIS); axis_move_end_ti.reset(); @@ -582,25 +582,27 @@ void FTMotion::loadBlockData(block_t * const current_block) { // Generate data points of the trajectory. void FTMotion::makeVector() { do { - float accel_k = 0.0f; // (mm/s^2) Acceleration K factor float tau = (makeVector_idx + 1) * (FTM_TS); // (s) Time since start of block float dist = 0.0f; // (mm) Distance traveled + #if HAS_EXTRUDERS + float accel_k = 0.0f; // (mm/s^2) Acceleration K factor + #endif if (makeVector_idx < N1) { // Acceleration phase dist = (f_s * tau) + (0.5f * accel_P * sq(tau)); // (mm) Distance traveled for acceleration phase since start of block - accel_k = accel_P; // (mm/s^2) Acceleration K factor from Accel phase + TERN_(HAS_EXTRUDERS, accel_k = accel_P); // (mm/s^2) Acceleration K factor from Accel phase } else if (makeVector_idx < (N1 + N2)) { // Coasting phase dist = s_1e + F_P * (tau - N1 * (FTM_TS)); // (mm) Distance traveled for coasting phase since start of block - //accel_k = 0.0f; + //TERN_(HAS_EXTRUDERS, accel_k = 0.0f); } else { // Deceleration phase tau -= (N1 + N2) * (FTM_TS); // (s) Time since start of decel phase dist = s_2e + F_P * tau + 0.5f * decel_P * sq(tau); // (mm) Distance traveled for deceleration phase since start of block - accel_k = decel_P; // (mm/s^2) Acceleration K factor from Decel phase + TERN_(HAS_EXTRUDERS, accel_k = decel_P); // (mm/s^2) Acceleration K factor from Decel phase } #define _SET_TRAJ(q) traj.q[makeVector_batchIdx] = startPosn.q + ratio.q * dist; diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index 4cf8017083..feaea55ca1 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -171,7 +171,7 @@ class FTMotion { #if ENABLED(DISTINCT_E_FACTORS) static uint8_t block_extruder_axis; // Cached extruder axis index - #else + #elif HAS_EXTRUDERS static constexpr uint8_t block_extruder_axis = E_AXIS; #endif diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index 13a8e1e719..3198c71cf3 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -71,8 +71,8 @@ opt_set MOTHERBOARD BOARD_RAMBO EXTRUDERS 0 TEMP_SENSOR_BED 1 TEMP_SENSOR_PROBE DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER FIX_MOUNTED_PROBE Z_SAFE_HOMING -exec_test $1 $2 "Rambo heated bed only" "$3" +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER FIX_MOUNTED_PROBE Z_SAFE_HOMING FT_MOTION +exec_test $1 $2 "Rambo with ZERO EXTRUDERS, heated bed, FT_MOTION" "$3" # # Rambo with MMU2