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 : simplified buffer management, resolution of all layer shift problems #26074

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
6f0dd21
FT_MOTION : Ulendo implementation merged into Marlin with last bugfix…
narno2202 Jul 5, 2023
14bb119
Update stepper.cpp, fix missing variable initialization
narno2202 Jul 7, 2023
b63440f
Remove if(!current_block) in void Stepper::fxdTiCtrl_BlockQueueUpdate…
narno2202 Jul 8, 2023
e64943b
Update ft_motion.cpp : change text to reflect code change
narno2202 Jul 9, 2023
24ebed2
Update M493.cpp, remove reset flag and call to reset()
narno2202 Jul 10, 2023
501c143
Update ft_motion.cpp, minor aesthetic code change
narno2202 Jul 10, 2023
a10de67
Update ft_motion.cpp: Fix copy-paste error on copy the uncompensated …
narno2202 Jul 11, 2023
86817e8
Move COMMAND_SET outside the loop in void FxdTiCtrl::convertToSteps(c…
narno2202 Jul 12, 2023
82fc473
Update M493.cpp, add comment
narno2202 Jul 13, 2023
54f5fc4
Merge Babystepping isr changes
narno2202 Jul 24, 2023
172e6f1
Merge branch 'bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Jul 24, 2023
c91463f
Fix unit conversion if STEPS_ROUNDING is enabled in ft_motion.cpp
narno2202 Jul 25, 2023
20a10ed
Merge branch 'bugfix-2.1.x' into pr/26074
thinkyhead Aug 7, 2023
faf5edb
Update Configuration_adv.h. Change FTM_STEPPERCMD_BUFF_SIZE to 3000
narno2202 Aug 11, 2023
37d5ce7
Update M493.cpp after comments from @ulendoalex about reset()
narno2202 Aug 17, 2023
84e98bd
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Aug 19, 2023
40b41fa
Fix sensorless homing with QUICK_HOME and FT_MOTION enabled
narno2202 Aug 20, 2023
07572df
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Aug 23, 2023
809cadb
Update ft_motion.cpp, solves back and forth motion of Z axis during UBL
narno2202 Aug 25, 2023
71b3402
Disable FT Motion for all of G28
thinkyhead Aug 26, 2023
6839f33
Remove unused include
narno2202 Aug 26, 2023
d49ec9b
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Aug 28, 2023
2effe7c
Update ft_motion.cpp for CoreXY motion as proposed by @ulendoalex
narno2202 Aug 28, 2023
c703de9
Correct typo for _MIN and _MAX macros
narno2202 Aug 29, 2023
6f64be9
Commit changes suggested by @ulendoalex for CoreXY printers
narno2202 Aug 30, 2023
0b3fe09
Revert last commit. Original max_feedrate compute
narno2202 Aug 30, 2023
ce1aa3d
Forget to delete one instance of max_feedrate
narno2202 Aug 30, 2023
5cfebde
Use 'FTM_MIN_TICKS'
thinkyhead Sep 5, 2023
3c8f16b
adjust formatting
thinkyhead Sep 5, 2023
5aa3f26
fix up indents
thinkyhead Sep 5, 2023
3beb11c
reduce
thinkyhead Sep 5, 2023
eefadac
Add missing braces, fix BLTouch HS mode with FT_MOTION enabled
narno2202 Sep 7, 2023
a4c6e2e
tweaks
thinkyhead Sep 8, 2023
5215a1d
define all needed FT_BIT_DIR/STEP
thinkyhead Sep 8, 2023
a668412
discard_current_block does that
thinkyhead Sep 8, 2023
a8146fb
Increase MINIMUM_STEPPER_POST_DIR_DELAY to 80ns for Trinamic drivers …
narno2202 Sep 9, 2023
777f6b7
Remove duplicate variable reset
narno2202 Sep 19, 2023
725e1a2
M493 optimized to call only once planner.synchronize() in all cases i…
narno2202 Sep 20, 2023
71a37f9
MINIMUM_STEPPER_POST_DIR_DELAY : 70ns seems enough to have BLTouch HS…
narno2202 Sep 21, 2023
8939524
Fix a typo
narno2202 Sep 22, 2023
878eefb
Unnecessary code removal
narno2202 Sep 23, 2023
6250500
use reset()
thinkyhead Sep 24, 2023
e319393
parens
thinkyhead Sep 24, 2023
60aeda2
Merge last changes suggested by @ulendoalex: axes_dir logic and debou…
narno2202 Sep 24, 2023
6bb51ab
Typo error
narno2202 Sep 24, 2023
414ec53
AXIS_MOVE_DEBOUNCE_SEC
thinkyhead Sep 24, 2023
6e607cb
Update stepper.cpp with @ulendoalex suggestion
narno2202 Sep 26, 2023
3a43586
Revert change as it breaks BLTouch + HS mode again
narno2202 Sep 26, 2023
55e24e1
Define some FT_MOTION variables outside a loop
narno2202 Oct 1, 2023
8e76b40
Merge last code review by @ulendoalex, code simplification and BLTouc…
narno2202 Oct 2, 2023
f21016e
misc. cleanup
thinkyhead Oct 3, 2023
2f00b81
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/26074
thinkyhead Oct 3, 2023
b25d144
Use AxisBits type
thinkyhead Oct 3, 2023
5d9cf0a
Fix Stepper::set_ft_axis_position
thinkyhead Oct 3, 2023
4f899bb
set_ft_axis_position => fxdTiCtrl_syncPosition
thinkyhead Oct 3, 2023
083512a
misc.
thinkyhead Oct 3, 2023
19e4bd1
branchless set didMoveReport
thinkyhead Oct 3, 2023
4596583
simplify
thinkyhead Oct 3, 2023
f080b9d
avoid expensive division
thinkyhead Oct 3, 2023
77250db
misc.
thinkyhead Oct 3, 2023
3190b97
Some simplifications in math
narno2202 Oct 7, 2023
d9fb325
Remove some unnecessary intermediate variables
narno2202 Oct 10, 2023
754d78c
Merge branch 'bugfix-2.1.x' into pr/26074
thinkyhead Oct 11, 2023
60f2528
no changes to msc_sd.cpp
thinkyhead Oct 11, 2023
0b390c3
fxdTiCtrl => ftMotion
thinkyhead Oct 12, 2023
d184d3b
ws
thinkyhead Oct 12, 2023
704a8be
Merge branch 'bugfix-2.1.x' into pr/26074
thinkyhead Oct 12, 2023
805ddf0
Merge branch 'bugfix-2.1.x' into pr/26074
thinkyhead Oct 12, 2023
f76c0e7
Remove unnecessary conditional, fix missing HAS_Y_AXIS OPTARG
narno2202 Oct 14, 2023
1e55c36
Try to move delta test outside the lopp in convertToSteps() to avoid …
narno2202 Oct 18, 2023
a530972
Avoid unnecessary test if LASER_FEATURE is not enabled
narno2202 Oct 21, 2023
ef3d370
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Oct 21, 2023
3ea074a
Remove inline directive (call from a pointer)
narno2202 Oct 22, 2023
9151cb3
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Oct 24, 2023
9f39303
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Oct 28, 2023
c67c654
Disable FT_MOTION while probing : G29, G35, G34_M422, G38, M48
narno2202 Oct 28, 2023
2fcb720
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Nov 4, 2023
0f819de
Minor changes in command_set functions and convertToSteps function
narno2202 Nov 4, 2023
0543de9
Assusme a ratio of 2 between FTM_WINDOW_SIZE and FTM_BATCH_SIZE,
narno2202 Nov 10, 2023
4524d78
Set FTM_ZMAX to 2 * (FTM_FS / FTM_MIN_SHAPE_FREQ), so all the shapers…
narno2202 Nov 12, 2023
d2d5fd0
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Nov 14, 2023
56acbb2
Allow fixed ratio or custom size for Window and Batch arrays (needed …
narno2202 Nov 15, 2023
d51f17c
Minor code change
narno2202 Nov 16, 2023
69247a9
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Nov 18, 2023
434245c
Remove a variable re-initialization as a new value is always assigned
narno2202 Nov 18, 2023
7f87d4f
Code simplification in ftMotion_stepper() function
narno2202 Nov 21, 2023
de7326e
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Nov 27, 2023
5025efd
Add a missing line of code
narno2202 Nov 28, 2023
4485661
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Dec 2, 2023
479b781
Probing is now insensitive to parameter or code changes, sensorless h…
narno2202 Dec 2, 2023
c0f518a
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Dec 5, 2023
10d838b
Allow damping and vibration tolerance for X and Y axis depending on t…
narno2202 Dec 5, 2023
aa4aa7c
Fix BLTouch HS mode, remove unsused code
narno2202 Dec 9, 2023
ff0d56b
Remove useless code in G38.cpp
narno2202 Dec 10, 2023
b1d32cf
adjust config
thinkyhead Dec 11, 2023
eb5a47e
fix bugs, format code, etc.
thinkyhead Dec 11, 2023
8ad913b
typo
thinkyhead Dec 11, 2023
829b9e5
Merge branch 'bugfix-2.1.x' into pr/26074
thinkyhead Dec 11, 2023
bc6b966
Merge branch 'MarlinFirmware:bugfix-2.1.x' into PR_Ulendo_FT_MOTION_fix
narno2202 Dec 16, 2023
eb436fc
Revert trajectory variables to previous declaration as with the new o…
narno2202 Dec 17, 2023
c0d9b10
Remove useless #if-#endif (trajectory variables)
narno2202 Dec 18, 2023
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
84 changes: 52 additions & 32 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1121,42 +1121,62 @@
#if ENABLED(FT_MOTION)
#define FTM_DEFAULT_MODE ftMotionMode_DISABLED // Default mode of fixed time control. (Enums in ft_types.h)
#define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED // Default mode of dynamic frequency calculation. (Enums in ft_types.h)
#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_SHAPING_ZETA 0.1f // Zeta used by input shapers.
#define FTM_SHAPING_V_TOL 0.05f // Vibration tolerance used by EI input shapers.
#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_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

#define FTM_SHAPING_V_TOL_X 0.05f // Vibration tolerance used by EI input shapers for X axis
#define FTM_SHAPING_V_TOL_Y 0.05f // Vibration tolerance used by EI input shapers for Y axis

//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters

/**
* Advanced configuration
*/
#define FTM_BATCH_SIZE 100 // Batch size for trajectory generation;
#define FTM_WINDOW_SIZE 200 // Window size for trajectory generation.
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (1 / FTM_TS)
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (1 / FTM_FS)
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update.
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps.
#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency.
#define FTM_ZMAX 100 // Maximum delays for shaping functions (even numbers only!).
// Calculate as:
// 1/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZV.
// (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZVD, MZV.
// 3/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 2HEI.
// 2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 3HEI.
#define FTM_STEPS_PER_UNIT_TIME 20 // Interpolated stepper commands per unit time.
// Calculate as (FTM_STEPPER_FS / FTM_FS).
#define FTM_CTS_COMPARE_VAL 10 // Comparison value used in interpolation algorithm.
// Calculate as (FTM_STEPS_PER_UNIT_TIME / 2).
// These values may be configured to adjust duration of loop().
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop().
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop().

// This value may be configured to adjust duration to consume the command buffer.
// Try increasing this value if stepper motion is not smooth.
#define FTM_STEPPERCMD_BUFF_SIZE 1000 // Size of the stepper command buffers.

//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters.
#define FTM_UNIFIED_BWS // DON'T DISABLE unless you use Ulendo FBS (not implemented)
#if ENABLED(FTM_UNIFIED_BWS)
#define FTM_BW_SIZE 100 // Unified Window and Batch size with a ratio of 2
#else
#define FTM_WINDOW_SIZE 200 // Custom Window size for trajectory generation needed by Ulendo FBS
#define FTM_BATCH_SIZE 100 // Custom Batch size for trajectory generation needed by Ulendo FBS
#endif

#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (Reciprocal of FTM_TS)
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (Reciprocal of FTM_FS)

// These values may be configured to adjust the duration of loop().
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop()
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop()

#if DISABLED(COREXY)
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update

// Use this to adjust the time required to consume the command buffer.
// Try increasing this value if stepper motion is choppy.
#define FTM_STEPPERCMD_BUFF_SIZE 3000 // Size of the stepper command buffers
// (FTM_STEPS_PER_LOOP * FTM_POINTS_PER_LOOP) is a good start
// If you run out of memory, fall back to 3000 and increase progressively
#else
// CoreXY motion needs a larger buffer size. These values are based on our testing.
#define FTM_STEPPER_FS 30000
#define FTM_STEPPERCMD_BUFF_SIZE 6000
#endif

#define FTM_STEPS_PER_UNIT_TIME (FTM_STEPPER_FS / FTM_FS) // Interpolated stepper commands per unit time
#define FTM_CTS_COMPARE_VAL (FTM_STEPS_PER_UNIT_TIME / 2) // Comparison value used in interpolation algorithm
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps

#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency
#define FTM_RATIO (FTM_FS / FTM_MIN_SHAPE_FREQ) // Factor for use in FTM_ZMAX. DON'T CHANGE.
#define FTM_ZMAX (FTM_RATIO * 2) // Maximum delays for shaping functions (even numbers only!)
// Calculate as:
// ZV : FTM_RATIO / 2
// ZVD, MZV : FTM_RATIO
// 2HEI : FTM_RATIO * 3 / 2
// 3HEI : FTM_RATIO * 2
#endif

/**
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/G35.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
* 41 - Counter-Clockwise M4
* 50 - Clockwise M5
* 51 - Counter-Clockwise M5
*
*/
**/
void GcodeSuite::G35() {

DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING));

if (DEBUGGING(LEVELING)) log_machine_info();
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class G29_State {
* There's no extra effect if you have a fixed Z probe.
*/
G29_TYPE GcodeSuite::G29() {

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

// Leveling state is persistent when done manually with multiple G29 commands
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM("
* S5 Reset and disable mesh
*/
void GcodeSuite::G29() {

DEBUG_SECTION(log_G29, "G29", true);

// G29 Q is also available if debugging
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/calibrate/G34_M422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* R Flag to recalculate points based on current probe offsets
*/
void GcodeSuite::G34() {

DEBUG_SECTION(log_G34, "G34", DEBUGGING(LEVELING));
if (DEBUGGING(LEVELING)) log_machine_info();

Expand Down
107 changes: 84 additions & 23 deletions Marlin/src/gcode/feature/ft_motion/M493.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "../../gcode.h"
#include "../../../module/ft_motion.h"
#include "../../../module/stepper.h"

void say_shaping() {
// FT Enabled
Expand All @@ -39,6 +40,8 @@ void say_shaping() {
default: break;
case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break;
case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break;
case ftMotionMode_ZVDD: SERIAL_ECHOPGM("ZVDD"); break;
case ftMotionMode_ZVDDD: SERIAL_ECHOPGM("ZVDDD"); break;
case ftMotionMode_EI: SERIAL_ECHOPGM("EI"); break;
case ftMotionMode_2HEI: SERIAL_ECHOPGM("2 Hump EI"); break;
case ftMotionMode_3HEI: SERIAL_ECHOPGM("3 Hump EI"); break;
Expand Down Expand Up @@ -155,20 +158,19 @@ void GcodeSuite::M493() {

if (!parser.seen_any())
flag.report_h = true;
else
planner.synchronize();
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved

// Parse 'S' mode parameter.
if (parser.seenval('S')) {
const ftMotionMode_t oldmm = ftMotion.cfg.mode,
newmm = (ftMotionMode_t)parser.value_byte();
const ftMotionMode_t newmm = (ftMotionMode_t)parser.value_byte();

if (newmm != oldmm) {
if (newmm != ftMotion.cfg.mode) {
switch (newmm) {
default: SERIAL_ECHOLNPGM("?Invalid control mode [S] value."); return;
#if HAS_X_AXIS
case ftMotionMode_ZV:
case ftMotionMode_ZVD:
case ftMotionMode_ZVDD:
case ftMotionMode_ZVDDD:
case ftMotionMode_EI:
case ftMotionMode_2HEI:
case ftMotionMode_3HEI:
Expand All @@ -177,11 +179,10 @@ void GcodeSuite::M493() {
//case ftMotionMode_DISCTF:
flag.update_n = flag.update_a = true;
#endif
case ftMotionMode_DISABLED:
case ftMotionMode_DISABLED: flag.reset_ft = true;
case ftMotionMode_ENABLED:
ftMotion.cfg.mode = newmm;
flag.report_h = true;
if (oldmm == ftMotionMode_DISABLED) flag.reset_ft = true;
break;
}
}
Expand All @@ -193,6 +194,7 @@ void GcodeSuite::M493() {
if (parser.seen('P')) {
const bool val = parser.value_bool();
ftMotion.cfg.linearAdvEna = val;
flag.report_h = true;
SERIAL_ECHO_TERNARY(val, "Linear Advance ", "en", "dis", "abled.\n");
}

Expand All @@ -216,22 +218,16 @@ void GcodeSuite::M493() {
if (ftMotion.cfg.modeHasShaper()) {
const dynFreqMode_t val = dynFreqMode_t(parser.value_byte());
switch (val) {
case dynFreqMode_DISABLED:
ftMotion.cfg.dynFreqMode = val;
flag.report_h = true;
break;
#if HAS_DYNAMIC_FREQ_MM
case dynFreqMode_Z_BASED:
ftMotion.cfg.dynFreqMode = val;
flag.report_h = true;
break;
#endif
#if HAS_DYNAMIC_FREQ_G
case dynFreqMode_MASS_BASED:
ftMotion.cfg.dynFreqMode = val;
flag.report_h = true;
break;
#endif
case dynFreqMode_DISABLED:
ftMotion.cfg.dynFreqMode = val;
flag.report_h = true;
break;
default:
SERIAL_ECHOLNPGM("?Invalid Dynamic Frequency Mode [D] value.");
break;
Expand Down Expand Up @@ -279,6 +275,36 @@ void GcodeSuite::M493() {
}
#endif

// Parse zeta parameter (X axis).
if (parser.seenval('I')) {
const float val = parser.value_float();
if (ftMotion.cfg.modeHasShaper()) {
if (WITHIN(val, 0.01f, 1.0f)) {
ftMotion.cfg.zeta[0] = val;
flag.update_n = flag.update_a = true;
}
else
SERIAL_ECHOLNPGM("Invalid X zeta [", AS_CHAR('I'), "] value."); // Zeta out of range.
}
else
SERIAL_ECHOLNPGM("Wrong mode for zeta parameter.");
}

// Parse vtol parameter (X axis).
if (parser.seenval('Q')) {
const float val = parser.value_float();
if (ftMotion.cfg.modeHasShaper() && IS_EI_MODE(ftMotion.cfg.mode)) {
if (WITHIN(val, 0.00f, 1.0f)) {
ftMotion.cfg.vtol[0] = val;
flag.update_a = true;
}
else
SERIAL_ECHOLNPGM("Invalid X vtol [", AS_CHAR('Q'), "] value."); // VTol out of range.
}
else
SERIAL_ECHOLNPGM("Wrong mode for vtol parameter.");
}

#endif // HAS_X_AXIS

#if HAS_Y_AXIS
Expand Down Expand Up @@ -310,15 +336,50 @@ void GcodeSuite::M493() {
}
#endif

// Parse zeta parameter (Y axis).
if (parser.seenval('J')) {
const float val = parser.value_float();
if (ftMotion.cfg.modeHasShaper()) {
if (WITHIN(val, 0.01f, 1.0f)) {
ftMotion.cfg.zeta[1] = val;
flag.update_n = flag.update_a = true;
}
else
SERIAL_ECHOLNPGM("Invalid Y zeta [", AS_CHAR('J'), "] value."); // Zeta Out of range
}
else
SERIAL_ECHOLNPGM("Wrong mode for zeta parameter.");
}

// Parse vtol parameter (Y axis).
if (parser.seenval('R')) {
const float val = parser.value_float();
if (ftMotion.cfg.modeHasShaper() && IS_EI_MODE(ftMotion.cfg.mode)) {
if (WITHIN(val, 0.00f, 1.0f)) {
ftMotion.cfg.vtol[1] = val;
flag.update_a = true;
}
else
SERIAL_ECHOLNPGM("Invalid Y vtol [", AS_CHAR('R'), "] value."); // VTol out of range.
}
else
SERIAL_ECHOLNPGM("Wrong mode for vtol parameter.");
}

#endif // HAS_Y_AXIS

#if HAS_X_AXIS
if (flag.update_n) ftMotion.refreshShapingN();
if (flag.update_a) ftMotion.updateShapingA();
#endif
if (flag.reset_ft) ftMotion.reset();
if (flag.report_h) say_shaping();
planner.synchronize();

if (flag.update_n) ftMotion.refreshShapingN();

if (flag.update_a) ftMotion.updateShapingA();

if (flag.reset_ft) {
stepper.ftMotion_syncPosition();
ftMotion.reset();
}

if (flag.report_h) say_shaping();
}

#endif // FT_MOTION
1 change: 1 addition & 0 deletions Marlin/src/gcode/probe/G38.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ inline bool G38_run_probe() {
* G38.5 - Probe away from workpiece, stop on contact break
*/
void GcodeSuite::G38(const int8_t subcode) {

// Get X Y Z E F
get_destination_from_command();

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
#elif HAS_DRIVER(A4988)
#define MINIMUM_STEPPER_POST_DIR_DELAY 200
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MINIMUM_STEPPER_POST_DIR_DELAY 60
#define MINIMUM_STEPPER_POST_DIR_DELAY 70
#else
#define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
#endif
Expand Down
6 changes: 4 additions & 2 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ namespace LanguageNarrow_en {
LSTR MSG_FTM_MODE = _UxGT("Motion Mode:");
LSTR MSG_FTM_ZV = _UxGT("ZV");
LSTR MSG_FTM_ZVD = _UxGT("ZVD");
LSTR MSG_FTM_ZVDD = _UxGT("ZVDD");
LSTR MSG_FTM_ZVDDD = _UxGT("ZVDDD");
LSTR MSG_FTM_EI = _UxGT("EI");
LSTR MSG_FTM_2HEI = _UxGT("2HEI");
LSTR MSG_FTM_3HEI = _UxGT("3HEI");
Expand All @@ -813,8 +815,8 @@ namespace LanguageNarrow_en {
LSTR MSG_FTM_MASS_BASED = _UxGT("Mass-based");
LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Base Freq.");
LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Dyn. Freq.");
LSTR MSG_FTM_ZETA = _UxGT("Damping");
LSTR MSG_FTM_VTOL = _UxGT("Vib. Level");
LSTR MSG_FTM_ZETA_N = _UxGT("@ Damping");
LSTR MSG_FTM_VTOL_N = _UxGT("@ Vib. Level");

LSTR MSG_LEVEL_X_AXIS = _UxGT("Level X Axis");
LSTR MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrate");
Expand Down
Loading
Loading