From 11046b23a92cbe3401dfbd370c295df0a17d923d Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Fri, 4 Oct 2024 01:32:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20FT=20Motion=20Linear=20Advance?= =?UTF-8?q?=20K=20factor=20nnnn.nn=20(#27416)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lost part of #26785 --- Marlin/Configuration_adv.h | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- Marlin/src/module/ft_motion.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7cda16dc0f..e2e7eebbbb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1135,7 +1135,7 @@ #define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers #define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers #define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false) - #define FTM_LINEAR_ADV_DEFAULT_K 0 // Default linear advance gain, integer value. (Acceleration-based scaling factor.) + #define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain. (Acceleration-based scaling factor.) #define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis #define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 5f2717cf84..b13ee11c29 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -464,7 +464,7 @@ void menu_move() { #if HAS_EXTRUDERS EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna); if (c.linearAdvEna || ENABLED(FT_MOTION_NO_MENU_TOGGLE)) - EDIT_ITEM(float42_52, MSG_ADVANCE_K, &c.linearAdvK, 0, 10); + EDIT_ITEM(float62, MSG_ADVANCE_K, &c.linearAdvK, 0.0f, 1000.0f); #endif } END_MENU(); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index b999dec7cb..7eb8dafa12 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -607,7 +607,7 @@ void FTMotion::makeVector() { #if HAS_EXTRUDERS if (cfg.linearAdvEna) { float dedt_adj = (traj.e[makeVector_batchIdx] - e_raw_z1) * (FTM_FS); - if (ratio.e > 0.0f) dedt_adj += accel_k * cfg.linearAdvK; + if (ratio.e > 0.0f) dedt_adj += accel_k * cfg.linearAdvK * 0.0001f; e_raw_z1 = traj.e[makeVector_batchIdx]; e_advanced_z1 += dedt_adj * (FTM_TS);