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

Store and display FT_MOTION linearadvance as a float with 4 digit and 2 decimals #26785

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7e4415c
Store FT_MOTION linearadvance as int and convert to the real value du…
narno2202 Feb 11, 2024
426dfa4
Change K factor range between 0.1 and 1 10e-6
narno2202 Feb 17, 2024
b5ca920
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 2, 2024
72069c2
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 4, 2024
5954e81
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 13, 2024
293ddb7
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 17, 2024
52939d4
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 22, 2024
b4126ad
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Mar 28, 2024
1a141fb
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Apr 1, 2024
b6f640a
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Apr 7, 2024
c1bff6e
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 May 5, 2024
4b60d57
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Jun 7, 2024
4580d1c
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Jun 16, 2024
9ce9514
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Jul 2, 2024
df71c81
Merge branch 'MarlinFirmware:bugfix-2.1.x' into FT_MOTION_linearadvance
narno2202 Jul 13, 2024
32e7246
this
thinkyhead Jul 15, 2024
4567f46
divide by a million?
thinkyhead Jul 15, 2024
2e1e1aa
f
thinkyhead Jul 15, 2024
7d9f168
decript
thinkyhead Jul 15, 2024
087e347
Merge branch 'bugfix-2.1.x' into pr/26785
thinkyhead Jul 15, 2024
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_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@
#define FTM_SHAPING_DEFAULT_X_FREQ 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_SHAPING_DEFAULT_Y_FREQ 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.0f // Default linear advance gain
#define FTM_LINEAR_ADV_DEFAULT_K 0 // Default linear advance gain, integer value. (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

Expand Down
9 changes: 6 additions & 3 deletions Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,18 @@ void menu_move() {

ftm_menu_get_msg_strings();

ft_config_t &c = ftMotion.cfg;

START_MENU();
SUBMENU(MSG_FTM_MODE, menu_ftm_mode);
MENU_ITEM_ADDON_START_RJ(ftmode.length()); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END();
SUBMENU(MSG_FTM_MODE, menu_ftm_mode);
MENU_ITEM_ADDON_START_RJ(ftmode.length()); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END();
#if HAS_DYNAMIC_FREQ
SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode);
MENU_ITEM_ADDON_START_RJ(dmode.length()); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END();
#endif
#if HAS_EXTRUDERS
EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &ftMotion.cfg.linearAdvEna);
EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna);
if (c.linearAdvEna) EDIT_ITEM(float62, MSG_ADVANCE_K, &c.linearAdvK, 0.0f, 1000.0f);
#endif

END_MENU();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/ft_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,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);
Expand Down
Loading