diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index fccdcc5dee..a81b2f711b 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index 4334f00787..d4c0a94206 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h index 2d983bf41f..2417891fb8 100644 --- a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h index 82643fd58f..b641e19715 100644 --- a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h index 18f453d32e..eeeaa4b1de 100644 --- a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h +++ b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h @@ -1130,42 +1130,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h index 0d081b6683..bee36a26e3 100644 --- a/config/examples/Alfawise/U20/Configuration_adv.h +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AliExpress/CL-260/Configuration_adv.h b/config/examples/AliExpress/CL-260/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/AliExpress/CL-260/Configuration_adv.h +++ b/config/examples/AliExpress/CL-260/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index 7ffd3d4747..eae8761ff2 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index f59945a66f..c8e248de32 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index f59945a66f..c8e248de32 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index e2b67bcb0d..a155ddf604 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index 9f1be51057..9e414a13dc 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index 510c3b8f4f..0032f6e42b 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/A9/Configuration_adv.h b/config/examples/Anet/A9/Configuration_adv.h index ff01efc2b4..01b1e4f775 100644 --- a/config/examples/Anet/A9/Configuration_adv.h +++ b/config/examples/Anet/A9/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/E10/Configuration_adv.h b/config/examples/Anet/E10/Configuration_adv.h index 62c4b4058a..96bfb14c74 100644 --- a/config/examples/Anet/E10/Configuration_adv.h +++ b/config/examples/Anet/E10/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/E16/BTT SKR 1.3/Configuration_adv.h b/config/examples/Anet/E16/BTT SKR 1.3/Configuration_adv.h index 4be929289a..c115a6cbde 100644 --- a/config/examples/Anet/E16/BTT SKR 1.3/Configuration_adv.h +++ b/config/examples/Anet/E16/BTT SKR 1.3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/E16/Stock/Configuration_adv.h b/config/examples/Anet/E16/Stock/Configuration_adv.h index 732dcaff38..303e18d896 100644 --- a/config/examples/Anet/E16/Stock/Configuration_adv.h +++ b/config/examples/Anet/E16/Stock/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET4+/Configuration_adv.h b/config/examples/Anet/ET4+/Configuration_adv.h index 503a715786..dd4607e3bc 100644 --- a/config/examples/Anet/ET4+/Configuration_adv.h +++ b/config/examples/Anet/ET4+/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET4-Pro/Configuration_adv.h b/config/examples/Anet/ET4-Pro/Configuration_adv.h index 503a715786..dd4607e3bc 100644 --- a/config/examples/Anet/ET4-Pro/Configuration_adv.h +++ b/config/examples/Anet/ET4-Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET4/Configuration_adv.h b/config/examples/Anet/ET4/Configuration_adv.h index e1d03bb034..1db6f3090e 100644 --- a/config/examples/Anet/ET4/Configuration_adv.h +++ b/config/examples/Anet/ET4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET4X/Configuration_adv.h b/config/examples/Anet/ET4X/Configuration_adv.h index e1d03bb034..1db6f3090e 100644 --- a/config/examples/Anet/ET4X/Configuration_adv.h +++ b/config/examples/Anet/ET4X/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET5-Pro/Configuration_adv.h b/config/examples/Anet/ET5-Pro/Configuration_adv.h index e080c9a04b..84cb12497e 100644 --- a/config/examples/Anet/ET5-Pro/Configuration_adv.h +++ b/config/examples/Anet/ET5-Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET5/Configuration_adv.h b/config/examples/Anet/ET5/Configuration_adv.h index e080c9a04b..84cb12497e 100644 --- a/config/examples/Anet/ET5/Configuration_adv.h +++ b/config/examples/Anet/ET5/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Anet/ET5X/Configuration_adv.h b/config/examples/Anet/ET5X/Configuration_adv.h index e080c9a04b..84cb12497e 100644 --- a/config/examples/Anet/ET5X/Configuration_adv.h +++ b/config/examples/Anet/ET5X/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/Chiron/Configuration_adv.h b/config/examples/AnyCubic/Chiron/Configuration_adv.h index 635274fcd4..b98526494f 100644 --- a/config/examples/AnyCubic/Chiron/Configuration_adv.h +++ b/config/examples/AnyCubic/Chiron/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/Mega Zero 2.0/Anycubic V1/Configuration_adv.h b/config/examples/AnyCubic/Mega Zero 2.0/Anycubic V1/Configuration_adv.h index 9ffc6cfb3a..68cb73be16 100644 --- a/config/examples/AnyCubic/Mega Zero 2.0/Anycubic V1/Configuration_adv.h +++ b/config/examples/AnyCubic/Mega Zero 2.0/Anycubic V1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/Mega Zero/Anycubic V1/Configuration_adv.h b/config/examples/AnyCubic/Mega Zero/Anycubic V1/Configuration_adv.h index ca83546dae..f6037f6ce2 100644 --- a/config/examples/AnyCubic/Mega Zero/Anycubic V1/Configuration_adv.h +++ b/config/examples/AnyCubic/Mega Zero/Anycubic V1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/Mega Zero/BigTreeTech SKR Mini MZ V1.0/Configuration_adv.h b/config/examples/AnyCubic/Mega Zero/BigTreeTech SKR Mini MZ V1.0/Configuration_adv.h index 5cd309e9b1..23d21e6a6f 100644 --- a/config/examples/AnyCubic/Mega Zero/BigTreeTech SKR Mini MZ V1.0/Configuration_adv.h +++ b/config/examples/AnyCubic/Mega Zero/BigTreeTech SKR Mini MZ V1.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/Vyper/Configuration_adv.h b/config/examples/AnyCubic/Vyper/Configuration_adv.h index 2cca702d5b..2fa35ec8f7 100644 --- a/config/examples/AnyCubic/Vyper/Configuration_adv.h +++ b/config/examples/AnyCubic/Vyper/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/i3 Mega/Trigorilla AVR/Configuration_adv.h b/config/examples/AnyCubic/i3 Mega/Trigorilla AVR/Configuration_adv.h index 7286ece448..68304d88fb 100644 --- a/config/examples/AnyCubic/i3 Mega/Trigorilla AVR/Configuration_adv.h +++ b/config/examples/AnyCubic/i3 Mega/Trigorilla AVR/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/i3 Mega/Trigorilla Pro STM32/Configuration_adv.h b/config/examples/AnyCubic/i3 Mega/Trigorilla Pro STM32/Configuration_adv.h index ab9c802862..e34058babd 100644 --- a/config/examples/AnyCubic/i3 Mega/Trigorilla Pro STM32/Configuration_adv.h +++ b/config/examples/AnyCubic/i3 Mega/Trigorilla Pro STM32/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index 5c55223202..87eb47cbef 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index c4e1e89ce8..12bd9640ba 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -1126,42 +1126,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Genius Pro/Configuration_adv.h b/config/examples/Artillery/Genius Pro/Configuration_adv.h index e42a0aaffd..3e34db09a3 100644 --- a/config/examples/Artillery/Genius Pro/Configuration_adv.h +++ b/config/examples/Artillery/Genius Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Genius/BLTouch/Configuration_adv.h b/config/examples/Artillery/Genius/BLTouch/Configuration_adv.h index bb408eec50..fc5baf298e 100644 --- a/config/examples/Artillery/Genius/BLTouch/Configuration_adv.h +++ b/config/examples/Artillery/Genius/BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Genius/V1/Configuration_adv.h b/config/examples/Artillery/Genius/V1/Configuration_adv.h index a06e7606f9..7779a62e02 100644 --- a/config/examples/Artillery/Genius/V1/Configuration_adv.h +++ b/config/examples/Artillery/Genius/V1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Hornet/Configuration_adv.h b/config/examples/Artillery/Hornet/Configuration_adv.h index 8cdfed78ee..ee690cf644 100644 --- a/config/examples/Artillery/Hornet/Configuration_adv.h +++ b/config/examples/Artillery/Hornet/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Sidewinder X1/0.9 BMG - E3D V6/Configuration_adv.h b/config/examples/Artillery/Sidewinder X1/0.9 BMG - E3D V6/Configuration_adv.h index 95af754f57..7357b39f6c 100644 --- a/config/examples/Artillery/Sidewinder X1/0.9 BMG - E3D V6/Configuration_adv.h +++ b/config/examples/Artillery/Sidewinder X1/0.9 BMG - E3D V6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Sidewinder X1/V1/Configuration_adv.h b/config/examples/Artillery/Sidewinder X1/V1/Configuration_adv.h index a06e7606f9..7779a62e02 100644 --- a/config/examples/Artillery/Sidewinder X1/V1/Configuration_adv.h +++ b/config/examples/Artillery/Sidewinder X1/V1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Artillery/Sidewinder X2/Configuration_adv.h b/config/examples/Artillery/Sidewinder X2/Configuration_adv.h index d8e50d3d19..3c68497e61 100644 --- a/config/examples/Artillery/Sidewinder X2/Configuration_adv.h +++ b/config/examples/Artillery/Sidewinder X2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Azteeg/X5GT/Configuration_adv.h b/config/examples/Azteeg/X5GT/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Azteeg/X5GT/Configuration_adv.h +++ b/config/examples/Azteeg/X5GT/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 64a2c23d44..59c7ffa603 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index 60eb37fc75..fec98c0c30 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/B1 SE Plus/Configuration_adv.h b/config/examples/BIQU/B1 SE Plus/Configuration_adv.h index c195dce069..a35d47e4ab 100644 --- a/config/examples/BIQU/B1 SE Plus/Configuration_adv.h +++ b/config/examples/BIQU/B1 SE Plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/B1 SE/Configuration_adv.h b/config/examples/BIQU/B1 SE/Configuration_adv.h index e41e67ef6a..981519db7a 100644 --- a/config/examples/BIQU/B1 SE/Configuration_adv.h +++ b/config/examples/BIQU/B1 SE/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/B1/Configuration_adv.h b/config/examples/BIQU/B1/Configuration_adv.h index 21e3f42d21..3d74c11579 100644 --- a/config/examples/BIQU/B1/Configuration_adv.h +++ b/config/examples/BIQU/B1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/BX/Configuration_adv.h b/config/examples/BIQU/BX/Configuration_adv.h index 52face2b55..c4bf1b7a9e 100644 --- a/config/examples/BIQU/BX/Configuration_adv.h +++ b/config/examples/BIQU/BX/Configuration_adv.h @@ -1122,42 +1122,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/Hurakan/Configuration_adv.h b/config/examples/BIQU/Hurakan/Configuration_adv.h index cc019dd2d1..222684b475 100644 --- a/config/examples/BIQU/Hurakan/Configuration_adv.h +++ b/config/examples/BIQU/Hurakan/Configuration_adv.h @@ -1122,42 +1122,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BIQU/Thunder Standard/Configuration_adv.h b/config/examples/BIQU/Thunder Standard/Configuration_adv.h index 340f9e8c4b..2d4e25522c 100644 --- a/config/examples/BIQU/Thunder Standard/Configuration_adv.h +++ b/config/examples/BIQU/Thunder Standard/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index ae4d40ce85..3749463b8e 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index ce8df134bb..a15a218602 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index ae4d40ce85..3749463b8e 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/CTC/A13/Configuration_adv.h b/config/examples/CTC/A13/Configuration_adv.h index df95ee272c..c81f1fe6a0 100644 --- a/config/examples/CTC/A13/Configuration_adv.h +++ b/config/examples/CTC/A13/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/CTC/Bizer/Configuration_adv.h b/config/examples/CTC/Bizer/Configuration_adv.h index ba925948d3..72c7eae78d 100644 --- a/config/examples/CTC/Bizer/Configuration_adv.h +++ b/config/examples/CTC/Bizer/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/CTC/i3 2560 Rev A/no probe/Configuration_adv.h b/config/examples/CTC/i3 2560 Rev A/no probe/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/CTC/i3 2560 Rev A/no probe/Configuration_adv.h +++ b/config/examples/CTC/i3 2560 Rev A/no probe/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 4f8906c007..af2984986d 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Copymaster3D/300/Configuration_adv.h b/config/examples/Copymaster3D/300/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Copymaster3D/300/Configuration_adv.h +++ b/config/examples/Copymaster3D/300/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Copymaster3D/400/Configuration_adv.h b/config/examples/Copymaster3D/400/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Copymaster3D/400/Configuration_adv.h +++ b/config/examples/Copymaster3D/400/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Copymaster3D/500/Configuration_adv.h b/config/examples/Copymaster3D/500/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Copymaster3D/500/Configuration_adv.h +++ b/config/examples/Copymaster3D/500/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 Max/Configuration_adv.h b/config/examples/Creality/CR-10 Max/Configuration_adv.h index 2264f9101f..29dd7bc77e 100644 --- a/config/examples/Creality/CR-10 Max/Configuration_adv.h +++ b/config/examples/Creality/CR-10 Max/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index 297aeb00f2..04a3dc547b 100644 --- a/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h b/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h index 209063dd75..1392770490 100644 --- a/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10 Mini/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 Mini/CrealityV1/Configuration_adv.h b/config/examples/Creality/CR-10 Mini/CrealityV1/Configuration_adv.h index bfa6eb6e50..caf242e153 100644 --- a/config/examples/Creality/CR-10 Mini/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/CR-10 Mini/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 Mini/MEEB-3DP/Configuration_adv.h b/config/examples/Creality/CR-10 Mini/MEEB-3DP/Configuration_adv.h index 6e7dd7ff55..76ca43b9c7 100644 --- a/config/examples/Creality/CR-10 Mini/MEEB-3DP/Configuration_adv.h +++ b/config/examples/Creality/CR-10 Mini/MEEB-3DP/Configuration_adv.h @@ -1120,42 +1120,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 S4/CrealityV1/Configuration_adv.h b/config/examples/Creality/CR-10 S4/CrealityV1/Configuration_adv.h index a56232c81e..73895b0553 100644 --- a/config/examples/Creality/CR-10 S4/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/CR-10 S4/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 1.2 with TFT35 E3 V3.0/Configuration_adv.h b/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 1.2 with TFT35 E3 V3.0/Configuration_adv.h index 43e51564bd..6c68f3c831 100644 --- a/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 1.2 with TFT35 E3 V3.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 1.2 with TFT35 E3 V3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 v3/Configuration_adv.h b/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 v3/Configuration_adv.h index 7cf3666453..4aa66e48c0 100644 --- a/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 v3/Configuration_adv.h +++ b/config/examples/Creality/CR-10 S5/BigTreeTech SKR Mini E3 v3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 S5/CrealityV1/Configuration_adv.h b/config/examples/Creality/CR-10 S5/CrealityV1/Configuration_adv.h index a56232c81e..73895b0553 100644 --- a/config/examples/Creality/CR-10 S5/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/CR-10 S5/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 S5/CrealityV2.2-BLTouch/Configuration_adv.h b/config/examples/Creality/CR-10 S5/CrealityV2.2-BLTouch/Configuration_adv.h index b72f05b998..062eb82274 100644 --- a/config/examples/Creality/CR-10 S5/CrealityV2.2-BLTouch/Configuration_adv.h +++ b/config/examples/Creality/CR-10 S5/CrealityV2.2-BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 V2/Configuration_adv.h b/config/examples/Creality/CR-10 V2/Configuration_adv.h index 91ba4d08e3..9047edfaca 100644 --- a/config/examples/Creality/CR-10 V2/Configuration_adv.h +++ b/config/examples/Creality/CR-10 V2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10 V3/Configuration_adv.h b/config/examples/Creality/CR-10 V3/Configuration_adv.h index cd149b25cd..deaad003e5 100644 --- a/config/examples/Creality/CR-10 V3/Configuration_adv.h +++ b/config/examples/Creality/CR-10 V3/Configuration_adv.h @@ -1123,42 +1123,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index 52fc3f4074..9ea7fad5d7 100644 --- a/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h b/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h index c7ca8d0353..200e81742f 100644 --- a/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10/CrealityV1/Configuration_adv.h b/config/examples/Creality/CR-10/CrealityV1/Configuration_adv.h index bd8b354176..24c133745e 100644 --- a/config/examples/Creality/CR-10/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/CR-10/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S Pro/Configuration_adv.h b/config/examples/Creality/CR-10S Pro/Configuration_adv.h index 0be17bedc9..daa286d08f 100644 --- a/config/examples/Creality/CR-10S Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-10S Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S/BigTreeTech SKR 1.4 Turbo TMC2209/Configuration_adv.h b/config/examples/Creality/CR-10S/BigTreeTech SKR 1.4 Turbo TMC2209/Configuration_adv.h index 49c6460434..3609ca5545 100644 --- a/config/examples/Creality/CR-10S/BigTreeTech SKR 1.4 Turbo TMC2209/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/BigTreeTech SKR 1.4 Turbo TMC2209/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S/BigTreeTech SKR 2.0 TMC2209/Configuration_adv.h b/config/examples/Creality/CR-10S/BigTreeTech SKR 2.0 TMC2209/Configuration_adv.h index a2bd5c7d55..699ca8f953 100644 --- a/config/examples/Creality/CR-10S/BigTreeTech SKR 2.0 TMC2209/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/BigTreeTech SKR 2.0 TMC2209/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/CR-10S/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index 52fc3f4074..9ea7fad5d7 100644 --- a/config/examples/Creality/CR-10S/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S/BigTreeTech SKR Pro v1.2/Configuration_adv.h b/config/examples/Creality/CR-10S/BigTreeTech SKR Pro v1.2/Configuration_adv.h index 6c5c5e5c40..c54fda36e1 100644 --- a/config/examples/Creality/CR-10S/BigTreeTech SKR Pro v1.2/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/BigTreeTech SKR Pro v1.2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-10S/CrealityV1/Configuration_adv.h b/config/examples/Creality/CR-10S/CrealityV1/Configuration_adv.h index eb70cc7990..73abb8310b 100644 --- a/config/examples/Creality/CR-10S/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-20 Pro/Configuration_adv.h b/config/examples/Creality/CR-20 Pro/Configuration_adv.h index 422bc7aa5a..84899020af 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-20 Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-20/RepRapWorld Minitronics20/Configuration_adv.h b/config/examples/Creality/CR-20/RepRapWorld Minitronics20/Configuration_adv.h index cba081ab93..807caa8152 100644 --- a/config/examples/Creality/CR-20/RepRapWorld Minitronics20/Configuration_adv.h +++ b/config/examples/Creality/CR-20/RepRapWorld Minitronics20/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-20/Stock/Configuration_adv.h b/config/examples/Creality/CR-20/Stock/Configuration_adv.h index cba081ab93..807caa8152 100644 --- a/config/examples/Creality/CR-20/Stock/Configuration_adv.h +++ b/config/examples/Creality/CR-20/Stock/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-30 PrintMill/Configuration_adv.h b/config/examples/Creality/CR-30 PrintMill/Configuration_adv.h index 261cfee057..d72430492d 100644 --- a/config/examples/Creality/CR-30 PrintMill/Configuration_adv.h +++ b/config/examples/Creality/CR-30 PrintMill/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-6 SE/Configuration_adv.h b/config/examples/Creality/CR-6 SE/Configuration_adv.h index 5efe29331c..1068a8d207 100644 --- a/config/examples/Creality/CR-6 SE/Configuration_adv.h +++ b/config/examples/Creality/CR-6 SE/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index edc4c68c94..4bc69f1b5a 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-2 Pro/CrealityV423/Configuration_adv.h b/config/examples/Creality/Ender-2 Pro/CrealityV423/Configuration_adv.h index 818993972a..c96de54d72 100644 --- a/config/examples/Creality/Ender-2 Pro/CrealityV423/Configuration_adv.h +++ b/config/examples/Creality/Ender-2 Pro/CrealityV423/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index a622209097..22d569822a 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Max Neo/Configuration_adv.h b/config/examples/Creality/Ender-3 Max Neo/Configuration_adv.h index 201a057e6c..a9e82b7b9a 100644 --- a/config/examples/Creality/Ender-3 Max Neo/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Max Neo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Max/Configuration_adv.h b/config/examples/Creality/Ender-3 Max/Configuration_adv.h index d23837282b..24a0f4ed22 100644 --- a/config/examples/Creality/Ender-3 Max/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Max/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Neo/Configuration_adv.h b/config/examples/Creality/Ender-3 Neo/Configuration_adv.h index aa9ad248f8..f77ef14604 100644 --- a/config/examples/Creality/Ender-3 Neo/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Neo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR 1.4 Turbo/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR 1.4 Turbo/Configuration_adv.h index c04a436df7..71d33d953a 100644 --- a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR 1.4 Turbo/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR 1.4 Turbo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h index 3b120dc8f6..dddb34e189 100644 --- a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h index 3b120dc8f6..dddb34e189 100644 --- a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index af7fb17024..43da908e35 100644 --- a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h index ad38689628..44bfd25140 100644 --- a/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/CrealityV1/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/CrealityV1/Configuration_adv.h index c503f81aed..1e2b1c89d3 100644 --- a/config/examples/Creality/Ender-3 Pro/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/CrealityV422/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/CrealityV422/Configuration_adv.h index d65f956c0c..0cfe6c111e 100644 --- a/config/examples/Creality/Ender-3 Pro/CrealityV422/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/CrealityV422/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 Pro/CrealityV427/Configuration_adv.h b/config/examples/Creality/Ender-3 Pro/CrealityV427/Configuration_adv.h index 45b339e805..f00ec3eed8 100644 --- a/config/examples/Creality/Ender-3 Pro/CrealityV427/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 Pro/CrealityV427/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 S1 Plus/Configuration_adv.h b/config/examples/Creality/Ender-3 S1 Plus/Configuration_adv.h index 18889b627e..8d703b4fdb 100644 --- a/config/examples/Creality/Ender-3 S1 Plus/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 S1 Plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 S1 Pro/Configuration_adv.h b/config/examples/Creality/Ender-3 S1 Pro/Configuration_adv.h index 18889b627e..8d703b4fdb 100644 --- a/config/examples/Creality/Ender-3 S1 Pro/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 S1 Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 S1/STM32F1/Configuration_adv.h b/config/examples/Creality/Ender-3 S1/STM32F1/Configuration_adv.h index c4a3d5cd86..a708c54ef5 100644 --- a/config/examples/Creality/Ender-3 S1/STM32F1/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 S1/STM32F1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 S1/STM32F4/Configuration_adv.h b/config/examples/Creality/Ender-3 S1/STM32F4/Configuration_adv.h index e79c637564..04baa2ca64 100644 --- a/config/examples/Creality/Ender-3 S1/STM32F4/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 S1/STM32F4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2 Neo/Configuration_adv.h b/config/examples/Creality/Ender-3 V2 Neo/Configuration_adv.h index 64d5d972e4..bc6fe93006 100644 --- a/config/examples/Creality/Ender-3 V2 Neo/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2 Neo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/CrealityUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/CrealityUI/Configuration_adv.h index 20a2a5fb18..1272d8d7af 100644 --- a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/CrealityUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/CrealityUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/MarlinUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/MarlinUI/Configuration_adv.h index 3be415117c..6387b5b029 100644 --- a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/MarlinUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR E3 Turbo/MarlinUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/CrealityUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/CrealityUI/Configuration_adv.h index 76eaeec162..e6454c6823 100644 --- a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/CrealityUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/CrealityUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/MarlinUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/MarlinUI/Configuration_adv.h index 6e43c2e4bf..5dab8d6986 100644 --- a/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/MarlinUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/BigTreeTech SKR Mini E3 v3/MarlinUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/CrealityV422/CrealityUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/CrealityV422/CrealityUI/Configuration_adv.h index 0e78e4d69c..a6c042a4db 100644 --- a/config/examples/Creality/Ender-3 V2/CrealityV422/CrealityUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/CrealityV422/CrealityUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3 V2/CrealityV422/MarlinUI/Configuration_adv.h b/config/examples/Creality/Ender-3 V2/CrealityV422/MarlinUI/Configuration_adv.h index 725951b6ab..56a15729b5 100644 --- a/config/examples/Creality/Ender-3 V2/CrealityV422/MarlinUI/Configuration_adv.h +++ b/config/examples/Creality/Ender-3 V2/CrealityV422/MarlinUI/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech E3 RRF/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech E3 RRF/Configuration_adv.h index 3f183de5db..9eb9da2446 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech E3 RRF/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech E3 RRF/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech Manta E3 EZ/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech Manta E3 EZ/Configuration_adv.h index 6f3858533c..18e014459f 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech Manta E3 EZ/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech Manta E3 EZ/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR 1.4/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR 1.4/Configuration_adv.h index 66762b1b6a..7bde972615 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR 1.4/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR 1.4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/2-into-1 Hotend/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/2-into-1 Hotend/Configuration_adv.h index 7a9f4b9d9f..f71792f88f 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/2-into-1 Hotend/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/2-into-1 Hotend/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Dual Z/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Dual Z/Configuration_adv.h index 64cfd5f478..b0de77c402 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Dual Z/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Dual Z/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Single Extruder/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Single Extruder/Configuration_adv.h index 7a9f4b9d9f..f71792f88f 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Single Extruder/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR E3 Turbo/Single Extruder/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR E3-DIP V1.1/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR E3-DIP V1.1/Configuration_adv.h index 438ae22d3c..d9651942f0 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR E3-DIP V1.1/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR E3-DIP V1.1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h index 2dcfcc0bb0..409f7eed78 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h index 2dcfcc0bb0..409f7eed78 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index 618748be97..d0a6cbc732 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h index 72e8b78a29..ed2f19829c 100644 --- a/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/CrealityV1/Configuration_adv.h b/config/examples/Creality/Ender-3/CrealityV1/Configuration_adv.h index c503f81aed..1e2b1c89d3 100644 --- a/config/examples/Creality/Ender-3/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/CrealityV422/Configuration_adv.h b/config/examples/Creality/Ender-3/CrealityV422/Configuration_adv.h index 9c2da05ad2..b140469f09 100644 --- a/config/examples/Creality/Ender-3/CrealityV422/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/CrealityV422/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/CrealityV427/Configuration_adv.h b/config/examples/Creality/Ender-3/CrealityV427/Configuration_adv.h index 45b339e805..f00ec3eed8 100644 --- a/config/examples/Creality/Ender-3/CrealityV427/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/CrealityV427/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/BLTouch/Configuration_adv.h b/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/BLTouch/Configuration_adv.h index 2b562b35b4..f03ce27f6d 100644 --- a/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/BLTouch/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/base/Configuration_adv.h b/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/base/Configuration_adv.h index 2b562b35b4..f03ce27f6d 100644 --- a/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/base/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/FYSETC Cheetah 1.2/base/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/FYSETC Cheetah 2.0/Configuration_adv.h b/config/examples/Creality/Ender-3/FYSETC Cheetah 2.0/Configuration_adv.h index 80739b0694..50b486e628 100644 --- a/config/examples/Creality/Ender-3/FYSETC Cheetah 2.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/FYSETC Cheetah 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/FYSETC Cheetah/BLTouch/Configuration_adv.h b/config/examples/Creality/Ender-3/FYSETC Cheetah/BLTouch/Configuration_adv.h index 2b562b35b4..f03ce27f6d 100644 --- a/config/examples/Creality/Ender-3/FYSETC Cheetah/BLTouch/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/FYSETC Cheetah/BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/FYSETC Cheetah/base/Configuration_adv.h b/config/examples/Creality/Ender-3/FYSETC Cheetah/base/Configuration_adv.h index 2b562b35b4..f03ce27f6d 100644 --- a/config/examples/Creality/Ender-3/FYSETC Cheetah/base/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/FYSETC Cheetah/base/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/MEEB-3DP/Configuration_adv.h b/config/examples/Creality/Ender-3/MEEB-3DP/Configuration_adv.h index 791a17d710..cc55cc831e 100644 --- a/config/examples/Creality/Ender-3/MEEB-3DP/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/MEEB-3DP/Configuration_adv.h @@ -1120,42 +1120,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/MKS Robin E3/V1.0/Configuration_adv.h b/config/examples/Creality/Ender-3/MKS Robin E3/V1.0/Configuration_adv.h index 25f7db0a41..540cb0b74b 100644 --- a/config/examples/Creality/Ender-3/MKS Robin E3/V1.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/MKS Robin E3/V1.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/MKS Robin E3/V1.1/Configuration_adv.h b/config/examples/Creality/Ender-3/MKS Robin E3/V1.1/Configuration_adv.h index abbebc728a..a495028c96 100644 --- a/config/examples/Creality/Ender-3/MKS Robin E3/V1.1/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/MKS Robin E3/V1.1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/MKS Robin E3P/Configuration_adv.h b/config/examples/Creality/Ender-3/MKS Robin E3P/Configuration_adv.h index e61a81bad0..f33ab8b877 100644 --- a/config/examples/Creality/Ender-3/MKS Robin E3P/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/MKS Robin E3P/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-3/TH3D EZBoard Lite V2/Configuration_adv.h b/config/examples/Creality/Ender-3/TH3D EZBoard Lite V2/Configuration_adv.h index 138e46fc9e..0ffd11ad9c 100644 --- a/config/examples/Creality/Ender-3/TH3D EZBoard Lite V2/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/TH3D EZBoard Lite V2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 66a597ef57..254230029f 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Plus/BigTreeTech SKR 3/Configuration_adv.h b/config/examples/Creality/Ender-5 Plus/BigTreeTech SKR 3/Configuration_adv.h index d6832b17c7..72a63c367c 100644 --- a/config/examples/Creality/Ender-5 Plus/BigTreeTech SKR 3/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Plus/BigTreeTech SKR 3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Plus/CrealityV1 (ORIGIN UI)/Configuration_adv.h b/config/examples/Creality/Ender-5 Plus/CrealityV1 (ORIGIN UI)/Configuration_adv.h index 584b13f492..f849212d52 100644 --- a/config/examples/Creality/Ender-5 Plus/CrealityV1 (ORIGIN UI)/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Plus/CrealityV1 (ORIGIN UI)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Plus/CrealityV1 (RELOADED UI)/Configuration_adv.h b/config/examples/Creality/Ender-5 Plus/CrealityV1 (RELOADED UI)/Configuration_adv.h index 7e62950d6d..ca5b4c7f27 100644 --- a/config/examples/Creality/Ender-5 Plus/CrealityV1 (RELOADED UI)/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Plus/CrealityV1 (RELOADED UI)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR E3 Turbo/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR E3 Turbo/Configuration_adv.h index d0451217fd..7775a22c55 100644 --- a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR E3 Turbo/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR E3 Turbo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h index 0f5621ecf3..b7045c21bf 100644 --- a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 2.0 with BLTouch/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 2.0 with BLTouch/Configuration_adv.h index 8adbe5100c..1f26b2a4c7 100644 --- a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 2.0 with BLTouch/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 2.0 with BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 3.0 with BLTouch-HighTemp/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 3.0 with BLTouch-HighTemp/Configuration_adv.h index 3f6f3661b1..7c9dc44350 100644 --- a/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 3.0 with BLTouch-HighTemp/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/BigTreeTech SKR Mini E3 3.0 with BLTouch-HighTemp/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/CrealityV1/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/CrealityV1/Configuration_adv.h index be86d42b4d..591020280b 100644 --- a/config/examples/Creality/Ender-5 Pro/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/CrealityV422/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/CrealityV422/Configuration_adv.h index fe5b2484fe..94a56182d4 100644 --- a/config/examples/Creality/Ender-5 Pro/CrealityV422/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/CrealityV422/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 Pro/CrealityV427/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/CrealityV427/Configuration_adv.h index 7b328c33ef..cdc88f4186 100644 --- a/config/examples/Creality/Ender-5 Pro/CrealityV427/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/CrealityV427/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5 S1/Configuration_adv.h b/config/examples/Creality/Ender-5 S1/Configuration_adv.h index fd045ae75b..f4117158e8 100644 --- a/config/examples/Creality/Ender-5 S1/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 S1/Configuration_adv.h @@ -1126,42 +1126,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo with BLTouch/Configuration_adv.h b/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo with BLTouch/Configuration_adv.h index d0451217fd..7775a22c55 100644 --- a/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo with BLTouch/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo with BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo/Configuration_adv.h b/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo/Configuration_adv.h index 80932a5d39..dd878ef388 100644 --- a/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/BigTreeTech SKR E3 Turbo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h index fe7f273c64..bfc5fef439 100644 --- a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 1.2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index de1730f908..0f244ae955 100644 --- a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 3.0 with BLTouch/Configuration_adv.h b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 3.0 with BLTouch/Configuration_adv.h index d3f81f7514..0d581da899 100644 --- a/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 3.0 with BLTouch/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/BigTreeTech SKR Mini E3 3.0 with BLTouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/CrealityV1/Configuration_adv.h b/config/examples/Creality/Ender-5/CrealityV1/Configuration_adv.h index c9b3e70329..db59ae9fe4 100644 --- a/config/examples/Creality/Ender-5/CrealityV1/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/CrealityV1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-5/CrealityV427/Configuration_adv.h b/config/examples/Creality/Ender-5/CrealityV427/Configuration_adv.h index d6129f5cf2..a1197c358e 100644 --- a/config/examples/Creality/Ender-5/CrealityV427/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/CrealityV427/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Creality/Ender-6/Configuration_adv.h b/config/examples/Creality/Ender-6/Configuration_adv.h index d68415d2f0..60c0f21ebd 100644 --- a/config/examples/Creality/Ender-6/Configuration_adv.h +++ b/config/examples/Creality/Ender-6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index a078f40a45..4d578c358b 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Daycom/3DP-100/Configuration_adv.h b/config/examples/Daycom/3DP-100/Configuration_adv.h index f4b04d93f3..a23bb16ab7 100644 --- a/config/examples/Daycom/3DP-100/Configuration_adv.h +++ b/config/examples/Daycom/3DP-100/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h index 5b0babac47..34429fc110 100644 --- a/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h +++ b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/EasyThreeD/ET4000PLUS/Configuration_adv.h b/config/examples/EasyThreeD/ET4000PLUS/Configuration_adv.h index 131c561589..8f136e40dd 100644 --- a/config/examples/EasyThreeD/ET4000PLUS/Configuration_adv.h +++ b/config/examples/EasyThreeD/ET4000PLUS/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 081cfa7899..7a1bc7a1ce 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Elegoo/Neptune 2/Configuration_adv.h b/config/examples/Elegoo/Neptune 2/Configuration_adv.h index c4b4e6160e..2728169922 100644 --- a/config/examples/Elegoo/Neptune 2/Configuration_adv.h +++ b/config/examples/Elegoo/Neptune 2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Eryone/Thinker SE/Configuration_adv.h b/config/examples/Eryone/Thinker SE/Configuration_adv.h index 7aab471e01..c00d1f66bc 100644 --- a/config/examples/Eryone/Thinker SE/Configuration_adv.h +++ b/config/examples/Eryone/Thinker SE/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Eryone/Thinker V2/Configuration_adv.h b/config/examples/Eryone/Thinker V2/Configuration_adv.h index baad2d1265..f665b3422d 100644 --- a/config/examples/Eryone/Thinker V2/Configuration_adv.h +++ b/config/examples/Eryone/Thinker V2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FYSETC/AIO_II/Configuration_adv.h b/config/examples/FYSETC/AIO_II/Configuration_adv.h index dc8d901b3c..9e4f823e2d 100644 --- a/config/examples/FYSETC/AIO_II/Configuration_adv.h +++ b/config/examples/FYSETC/AIO_II/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FYSETC/F6_13/Configuration_adv.h b/config/examples/FYSETC/F6_13/Configuration_adv.h index c30a728c42..5a7244184f 100644 --- a/config/examples/FYSETC/F6_13/Configuration_adv.h +++ b/config/examples/FYSETC/F6_13/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FYSETC/S6/Configuration_adv.h b/config/examples/FYSETC/S6/Configuration_adv.h index 4fce572734..a83789e647 100644 --- a/config/examples/FYSETC/S6/Configuration_adv.h +++ b/config/examples/FYSETC/S6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Felix/DUAL/Configuration_adv.h b/config/examples/Felix/DUAL/Configuration_adv.h index ce75a179ca..49745fbded 100644 --- a/config/examples/Felix/DUAL/Configuration_adv.h +++ b/config/examples/Felix/DUAL/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Felix/Single/Configuration_adv.h b/config/examples/Felix/Single/Configuration_adv.h index ce75a179ca..49745fbded 100644 --- a/config/examples/Felix/Single/Configuration_adv.h +++ b/config/examples/Felix/Single/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FlashForge/Creator 2X/Configuration_adv.h b/config/examples/FlashForge/Creator 2X/Configuration_adv.h index e008bd911f..84d65365c1 100644 --- a/config/examples/FlashForge/Creator 2X/Configuration_adv.h +++ b/config/examples/FlashForge/Creator 2X/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 4aba43630a..94e3bacede 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FlyingBear/P902/Configuration_adv.h b/config/examples/FlyingBear/P902/Configuration_adv.h index 599c59efd7..12e0e3a8be 100644 --- a/config/examples/FlyingBear/P902/Configuration_adv.h +++ b/config/examples/FlyingBear/P902/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FlyingBear/P905H/Configuration_adv.h b/config/examples/FlyingBear/P905H/Configuration_adv.h index a6cc63a1a6..74b155757e 100644 --- a/config/examples/FlyingBear/P905H/Configuration_adv.h +++ b/config/examples/FlyingBear/P905H/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FoamCutter/generic/Configuration_adv.h b/config/examples/FoamCutter/generic/Configuration_adv.h index d7c887300c..203660e302 100644 --- a/config/examples/FoamCutter/generic/Configuration_adv.h +++ b/config/examples/FoamCutter/generic/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FoamCutter/rcKeith/Configuration_adv.h b/config/examples/FoamCutter/rcKeith/Configuration_adv.h index d7c887300c..203660e302 100644 --- a/config/examples/FoamCutter/rcKeith/Configuration_adv.h +++ b/config/examples/FoamCutter/rcKeith/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FolgerTech/FT-5 R2/Configuration_adv.h b/config/examples/FolgerTech/FT-5 R2/Configuration_adv.h index bc08c40be0..904a4eb759 100644 --- a/config/examples/FolgerTech/FT-5 R2/Configuration_adv.h +++ b/config/examples/FolgerTech/FT-5 R2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index ee9fa803bd..e2ce78aa37 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index 943395376e..842224242e 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index d9dea49ff1..f4b7e6e93e 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index 30ebf7a123..5447f16d83 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -1125,42 +1125,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index 699fdf7e67..97716677a2 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10D/Configuration_adv.h b/config/examples/Geeetech/A10D/Configuration_adv.h index 2761a15bb6..68d4a8b0d3 100644 --- a/config/examples/Geeetech/A10D/Configuration_adv.h +++ b/config/examples/Geeetech/A10D/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10M/Stock LCD/Configuration_adv.h b/config/examples/Geeetech/A10M/Stock LCD/Configuration_adv.h index 37e4818dc5..24fac32f98 100644 --- a/config/examples/Geeetech/A10M/Stock LCD/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Stock LCD/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10M/YHCB2004_V4.1/Configuration_adv.h b/config/examples/Geeetech/A10M/YHCB2004_V4.1/Configuration_adv.h index 37e4818dc5..24fac32f98 100644 --- a/config/examples/Geeetech/A10M/YHCB2004_V4.1/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/YHCB2004_V4.1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10PRO/Configuration_adv.h b/config/examples/Geeetech/A10PRO/Configuration_adv.h index 699fdf7e67..97716677a2 100644 --- a/config/examples/Geeetech/A10PRO/Configuration_adv.h +++ b/config/examples/Geeetech/A10PRO/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10T/Stock LCD/Configuration_adv.h b/config/examples/Geeetech/A10T/Stock LCD/Configuration_adv.h index 37e4818dc5..24fac32f98 100644 --- a/config/examples/Geeetech/A10T/Stock LCD/Configuration_adv.h +++ b/config/examples/Geeetech/A10T/Stock LCD/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A10T/YHCB2004_V4.1/Configuration_adv.h b/config/examples/Geeetech/A10T/YHCB2004_V4.1/Configuration_adv.h index 37e4818dc5..24fac32f98 100644 --- a/config/examples/Geeetech/A10T/YHCB2004_V4.1/Configuration_adv.h +++ b/config/examples/Geeetech/A10T/YHCB2004_V4.1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A20/Configuration_adv.h b/config/examples/Geeetech/A20/Configuration_adv.h index 7f69ea787a..8faf17e426 100644 --- a/config/examples/Geeetech/A20/Configuration_adv.h +++ b/config/examples/Geeetech/A20/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index 7f69ea787a..8faf17e426 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A20T/Configuration_adv.h b/config/examples/Geeetech/A20T/Configuration_adv.h index 7f69ea787a..8faf17e426 100644 --- a/config/examples/Geeetech/A20T/Configuration_adv.h +++ b/config/examples/Geeetech/A20T/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A30/Configuration_adv.h b/config/examples/Geeetech/A30/Configuration_adv.h index 8d66717543..7cf9c36344 100644 --- a/config/examples/Geeetech/A30/Configuration_adv.h +++ b/config/examples/Geeetech/A30/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A30M/Configuration_adv.h b/config/examples/Geeetech/A30M/Configuration_adv.h index 8d66717543..7cf9c36344 100644 --- a/config/examples/Geeetech/A30M/Configuration_adv.h +++ b/config/examples/Geeetech/A30M/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/A30T/Configuration_adv.h b/config/examples/Geeetech/A30T/Configuration_adv.h index 8d66717543..7cf9c36344 100644 --- a/config/examples/Geeetech/A30T/Configuration_adv.h +++ b/config/examples/Geeetech/A30T/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/D200/Configuration_adv.h b/config/examples/Geeetech/D200/Configuration_adv.h index 2e6c59ccde..aa8e67df72 100644 --- a/config/examples/Geeetech/D200/Configuration_adv.h +++ b/config/examples/Geeetech/D200/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Duplicator5/Configuration_adv.h b/config/examples/Geeetech/Duplicator5/Configuration_adv.h index 4fce572734..a83789e647 100644 --- a/config/examples/Geeetech/Duplicator5/Configuration_adv.h +++ b/config/examples/Geeetech/Duplicator5/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/E180/Configuration_adv.h b/config/examples/Geeetech/E180/Configuration_adv.h index 8d66717543..7cf9c36344 100644 --- a/config/examples/Geeetech/E180/Configuration_adv.h +++ b/config/examples/Geeetech/E180/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/GT2560/Configuration_adv.h b/config/examples/Geeetech/GT2560/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Geeetech/GT2560/Configuration_adv.h +++ b/config/examples/Geeetech/GT2560/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration_adv.h b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration_adv.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/M201/Configuration_adv.h b/config/examples/Geeetech/M201/Configuration_adv.h index 2e6c59ccde..aa8e67df72 100644 --- a/config/examples/Geeetech/M201/Configuration_adv.h +++ b/config/examples/Geeetech/M201/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index e297a22dde..aba0f15cd4 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Me_creator/Configuration_adv.h b/config/examples/Geeetech/Me_creator/Configuration_adv.h index 4fce572734..a83789e647 100644 --- a/config/examples/Geeetech/Me_creator/Configuration_adv.h +++ b/config/examples/Geeetech/Me_creator/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Me_ducer/Configuration_adv.h b/config/examples/Geeetech/Me_ducer/Configuration_adv.h index 9f294568d5..f0adfde70c 100644 --- a/config/examples/Geeetech/Me_ducer/Configuration_adv.h +++ b/config/examples/Geeetech/Me_ducer/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/PI3A PRO/Configuration_adv.h b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h index 41647cdce0..dbd6220d66 100644 --- a/config/examples/Geeetech/PI3A PRO/Configuration_adv.h +++ b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 699fdf7e67..97716677a2 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 699fdf7e67..97716677a2 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/HMS434/Configuration_adv.h b/config/examples/HMS434/Configuration_adv.h index 80fd1717d6..bbedefee82 100644 --- a/config/examples/HMS434/Configuration_adv.h +++ b/config/examples/HMS434/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index 335bb08210..3feb74a764 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Intamsys/FunmatHT 4988/Configuration_adv.h b/config/examples/Intamsys/FunmatHT 4988/Configuration_adv.h index 75f991ad1d..a7583c29d1 100644 --- a/config/examples/Intamsys/FunmatHT 4988/Configuration_adv.h +++ b/config/examples/Intamsys/FunmatHT 4988/Configuration_adv.h @@ -1120,42 +1120,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/JGAurora/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index e0ea341139..e6947e57db 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -1127,42 +1127,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/JGAurora/A3/Configuration_adv.h b/config/examples/JGAurora/A3/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/JGAurora/A3/Configuration_adv.h +++ b/config/examples/JGAurora/A3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index 06c30cec77..44ef1fe0fc 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/JGAurora/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index 0b0ed81321..c012765925 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -1127,42 +1127,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/JGAurora/Magic/Configuration_adv.h b/config/examples/JGAurora/Magic/Configuration_adv.h index fda5d1072d..f337ed1749 100644 --- a/config/examples/JGAurora/Magic/Configuration_adv.h +++ b/config/examples/JGAurora/Magic/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Kingroon/KP3/Configuration_adv.h b/config/examples/Kingroon/KP3/Configuration_adv.h index 99e8f72b92..60a4ff9cee 100644 --- a/config/examples/Kingroon/KP3/Configuration_adv.h +++ b/config/examples/Kingroon/KP3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Kingroon/KP3S/Configuration_adv.h b/config/examples/Kingroon/KP3S/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Kingroon/KP3S/Configuration_adv.h +++ b/config/examples/Kingroon/KP3S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Kingroon/KP3S_Pro/Configuration_adv.h b/config/examples/Kingroon/KP3S_Pro/Configuration_adv.h index 2521a9b276..0962beb96f 100644 --- a/config/examples/Kingroon/KP3S_Pro/Configuration_adv.h +++ b/config/examples/Kingroon/KP3S_Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Kingroon/KP5L-DIY/Configuration_adv.h b/config/examples/Kingroon/KP5L-DIY/Configuration_adv.h index 0c9980c6a6..941fb675eb 100644 --- a/config/examples/Kingroon/KP5L-DIY/Configuration_adv.h +++ b/config/examples/Kingroon/KP5L-DIY/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Labists/ET4/Configuration_adv.h b/config/examples/Labists/ET4/Configuration_adv.h index 503a715786..dd4607e3bc 100644 --- a/config/examples/Labists/ET4/Configuration_adv.h +++ b/config/examples/Labists/ET4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Longer/LK5/Configuration_adv.h b/config/examples/Longer/LK5/Configuration_adv.h index ee2eaf4523..2a40d92b45 100644 --- a/config/examples/Longer/LK5/Configuration_adv.h +++ b/config/examples/Longer/LK5/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/LulzBot/Mini2/Teensy/Configuration_adv.h b/config/examples/LulzBot/Mini2/Teensy/Configuration_adv.h index d5eaa886cf..052aa5a1b9 100644 --- a/config/examples/LulzBot/Mini2/Teensy/Configuration_adv.h +++ b/config/examples/LulzBot/Mini2/Teensy/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/LulzBot/TAZ4/Configuration_adv.h b/config/examples/LulzBot/TAZ4/Configuration_adv.h index 98a64502fe..5cfd7cba68 100644 --- a/config/examples/LulzBot/TAZ4/Configuration_adv.h +++ b/config/examples/LulzBot/TAZ4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/MBot/Cube/Configuration_adv.h b/config/examples/MBot/Cube/Configuration_adv.h index 6cae3d6705..261a2c79fc 100644 --- a/config/examples/MBot/Cube/Configuration_adv.h +++ b/config/examples/MBot/Cube/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/MakerFarm/Pegasus 12/Configuration_adv.h b/config/examples/MakerFarm/Pegasus 12/Configuration_adv.h index 3c0402fc51..cb551107de 100644 --- a/config/examples/MakerFarm/Pegasus 12/Configuration_adv.h +++ b/config/examples/MakerFarm/Pegasus 12/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index ba25d2b6d1..7725b79c18 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/MakerTech3D/Proforge2sDual/Configuration_adv.h b/config/examples/MakerTech3D/Proforge2sDual/Configuration_adv.h index 8745d2da73..b9c7b1731f 100644 --- a/config/examples/MakerTech3D/Proforge2sDual/Configuration_adv.h +++ b/config/examples/MakerTech3D/Proforge2sDual/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 208e6f4685..e695ed0969 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Malyan/M180/Configuration_adv.h b/config/examples/Malyan/M180/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Malyan/M180/Configuration_adv.h +++ b/config/examples/Malyan/M180/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 8f4c3ecdb2..40053488ce 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -1123,42 +1123,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Micromake/C1/basic/Configuration_adv.h b/config/examples/Micromake/C1/basic/Configuration_adv.h index 70bf2ebe59..6d7bea1984 100644 --- a/config/examples/Micromake/C1/basic/Configuration_adv.h +++ b/config/examples/Micromake/C1/basic/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 6ac83f9f15..a56a3a8f3c 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Mks/Robin_Lite3/Configuration_adv.h b/config/examples/Mks/Robin_Lite3/Configuration_adv.h index 9341eabe9c..e71beb17a7 100644 --- a/config/examples/Mks/Robin_Lite3/Configuration_adv.h +++ b/config/examples/Mks/Robin_Lite3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Mks/Robin_Pro/Configuration_adv.h b/config/examples/Mks/Robin_Pro/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Mks/Robin_Pro/Configuration_adv.h +++ b/config/examples/Mks/Robin_Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 617f882371..85b4b8d0c6 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Modix/Big60/Configuration_adv.h b/config/examples/Modix/Big60/Configuration_adv.h index 565861d51d..10a25a567d 100644 --- a/config/examples/Modix/Big60/Configuration_adv.h +++ b/config/examples/Modix/Big60/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Nextion/Configuration_adv.h b/config/examples/Nextion/Configuration_adv.h index b3009df5d9..faba75b214 100644 --- a/config/examples/Nextion/Configuration_adv.h +++ b/config/examples/Nextion/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/ORD Bot/Hadron/Sanguinololu/Configuration_adv.h b/config/examples/ORD Bot/Hadron/Sanguinololu/Configuration_adv.h index cc21f57168..83eb48effd 100644 --- a/config/examples/ORD Bot/Hadron/Sanguinololu/Configuration_adv.h +++ b/config/examples/ORD Bot/Hadron/Sanguinololu/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Opulo/Lumen_REV3/Configuration_adv.h b/config/examples/Opulo/Lumen_REV3/Configuration_adv.h index ec852f0939..9a728c15f9 100644 --- a/config/examples/Opulo/Lumen_REV3/Configuration_adv.h +++ b/config/examples/Opulo/Lumen_REV3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Opulo/Lumen_REV4/Configuration_adv.h b/config/examples/Opulo/Lumen_REV4/Configuration_adv.h index 091dbb52c4..45a2332a60 100644 --- a/config/examples/Opulo/Lumen_REV4/Configuration_adv.h +++ b/config/examples/Opulo/Lumen_REV4/Configuration_adv.h @@ -1120,42 +1120,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ortur 4/Configuration_adv.h b/config/examples/Ortur 4/Configuration_adv.h index 85f5c79be8..9fa690572c 100644 --- a/config/examples/Ortur 4/Configuration_adv.h +++ b/config/examples/Ortur 4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Polargraph/Configuration_adv.h b/config/examples/Polargraph/Configuration_adv.h index a8205b2c43..c12ca8f641 100644 --- a/config/examples/Polargraph/Configuration_adv.h +++ b/config/examples/Polargraph/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Printrbot/PrintrboardG2/Configuration_adv.h b/config/examples/Printrbot/PrintrboardG2/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration_adv.h +++ b/config/examples/Printrbot/PrintrboardG2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Printrbot/Simple Metal RevD/Configuration_adv.h b/config/examples/Printrbot/Simple Metal RevD/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Printrbot/Simple Metal RevD/Configuration_adv.h +++ b/config/examples/Printrbot/Simple Metal RevD/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Prusa/MK3/Configuration_adv.h b/config/examples/Prusa/MK3/Configuration_adv.h index f68368b49b..db9b3d2b34 100644 --- a/config/examples/Prusa/MK3/Configuration_adv.h +++ b/config/examples/Prusa/MK3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Prusa/MK3S-BigTreeTech-BTT002/Configuration_adv.h b/config/examples/Prusa/MK3S-BigTreeTech-BTT002/Configuration_adv.h index feb25599ec..5309bd7624 100644 --- a/config/examples/Prusa/MK3S-BigTreeTech-BTT002/Configuration_adv.h +++ b/config/examples/Prusa/MK3S-BigTreeTech-BTT002/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Qidi/Qidi 1/Configuration_adv.h b/config/examples/Qidi/Qidi 1/Configuration_adv.h index ea33d6081a..7e56716ba4 100644 --- a/config/examples/Qidi/Qidi 1/Configuration_adv.h +++ b/config/examples/Qidi/Qidi 1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Raiscube/A8r/Configuration_adv.h b/config/examples/Raiscube/A8r/Configuration_adv.h index e2b67bcb0d..a155ddf604 100644 --- a/config/examples/Raiscube/A8r/Configuration_adv.h +++ b/config/examples/Raiscube/A8r/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index 4fce572734..a83789e647 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Renkforce/RF100/Configuration_adv.h b/config/examples/Renkforce/RF100/Configuration_adv.h index 97953911a7..30e4b74b8c 100644 --- a/config/examples/Renkforce/RF100/Configuration_adv.h +++ b/config/examples/Renkforce/RF100/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Renkforce/RF100XL/Configuration_adv.h b/config/examples/Renkforce/RF100XL/Configuration_adv.h index 97953911a7..30e4b74b8c 100644 --- a/config/examples/Renkforce/RF100XL/Configuration_adv.h +++ b/config/examples/Renkforce/RF100XL/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Renkforce/RF100v2/Configuration_adv.h b/config/examples/Renkforce/RF100v2/Configuration_adv.h index 97953911a7..30e4b74b8c 100644 --- a/config/examples/Renkforce/RF100v2/Configuration_adv.h +++ b/config/examples/Renkforce/RF100v2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/RepRapPro/Huxley/Configuration_adv.h b/config/examples/RepRapPro/Huxley/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/RepRapPro/Huxley/Configuration_adv.h +++ b/config/examples/RepRapPro/Huxley/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/RepRapWorld/Megatronics/Configuration_adv.h b/config/examples/RepRapWorld/Megatronics/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration_adv.h +++ b/config/examples/RepRapWorld/Megatronics/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/RepRapWorld/Minitronics20/CNC/Configuration_adv.h b/config/examples/RepRapWorld/Minitronics20/CNC/Configuration_adv.h index a081ed24a5..f2bd0255c2 100644 --- a/config/examples/RepRapWorld/Minitronics20/CNC/Configuration_adv.h +++ b/config/examples/RepRapWorld/Minitronics20/CNC/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index 692a72f8a6..780f5a6827 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Robo3D/R1+/Configuration_adv.h b/config/examples/Robo3D/R1+/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Robo3D/R1+/Configuration_adv.h +++ b/config/examples/Robo3D/R1+/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/SCARA/MP_SCARA/Configuration_adv.h b/config/examples/SCARA/MP_SCARA/Configuration_adv.h index f0395ca394..5b07f88b9b 100644 --- a/config/examples/SCARA/MP_SCARA/Configuration_adv.h +++ b/config/examples/SCARA/MP_SCARA/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/SCARA/Morgan/Configuration_adv.h b/config/examples/SCARA/Morgan/Configuration_adv.h index c5cf1c0de2..032e1e5682 100644 --- a/config/examples/SCARA/Morgan/Configuration_adv.h +++ b/config/examples/SCARA/Morgan/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index 0751601eab..4d9f28bee3 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/STM32/STM32F103RE/Configuration_adv.h b/config/examples/STM32/STM32F103RE/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/STM32/STM32F103RE/Configuration_adv.h +++ b/config/examples/STM32/STM32F103RE/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Simax/Mi-M200/Configuration_adv.h b/config/examples/Simax/Mi-M200/Configuration_adv.h index 38c82f8f36..ae864f449c 100644 --- a/config/examples/Simax/Mi-M200/Configuration_adv.h +++ b/config/examples/Simax/Mi-M200/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Simulator/Configuration_adv.h b/config/examples/Simulator/Configuration_adv.h index 80bc61a3d8..82ffd988e3 100644 --- a/config/examples/Simulator/Configuration_adv.h +++ b/config/examples/Simulator/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-01/BigTreeTech SKR E3 Turbo/Configuration_adv.h b/config/examples/Sovol/SV-01/BigTreeTech SKR E3 Turbo/Configuration_adv.h index f96e0cec17..0353de1345 100644 --- a/config/examples/Sovol/SV-01/BigTreeTech SKR E3 Turbo/Configuration_adv.h +++ b/config/examples/Sovol/SV-01/BigTreeTech SKR E3 Turbo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index 081f8bf91a..de13e89648 100644 --- a/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h b/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h index a282901896..24a698f3de 100644 --- a/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h +++ b/config/examples/Sovol/SV-01/BigTreeTech SKR Mini E3 3.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-01/CrealityV22/Configuration_adv.h b/config/examples/Sovol/SV-01/CrealityV22/Configuration_adv.h index 6907ed01fa..bc8f5d5abc 100644 --- a/config/examples/Sovol/SV-01/CrealityV22/Configuration_adv.h +++ b/config/examples/Sovol/SV-01/CrealityV22/Configuration_adv.h @@ -1123,42 +1123,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-01/CrealityV221/Configuration_adv.h b/config/examples/Sovol/SV-01/CrealityV221/Configuration_adv.h index cdff835e55..176e631135 100644 --- a/config/examples/Sovol/SV-01/CrealityV221/Configuration_adv.h +++ b/config/examples/Sovol/SV-01/CrealityV221/Configuration_adv.h @@ -1123,42 +1123,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-02/Configuration_adv.h b/config/examples/Sovol/SV-02/Configuration_adv.h index 6a1e4086be..605e71352f 100644 --- a/config/examples/Sovol/SV-02/Configuration_adv.h +++ b/config/examples/Sovol/SV-02/Configuration_adv.h @@ -1123,42 +1123,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sovol/SV-03/Configuration_adv.h b/config/examples/Sovol/SV-03/Configuration_adv.h index 454cdd0b30..bcc91f3575 100644 --- a/config/examples/Sovol/SV-03/Configuration_adv.h +++ b/config/examples/Sovol/SV-03/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sunlu/S8/Configuration_adv.h b/config/examples/Sunlu/S8/Configuration_adv.h index 0f61dda3a0..f3971360c4 100644 --- a/config/examples/Sunlu/S8/Configuration_adv.h +++ b/config/examples/Sunlu/S8/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Sunlu/T3/Configuration_adv.h b/config/examples/Sunlu/T3/Configuration_adv.h index 0291a529a1..5027da3f48 100644 --- a/config/examples/Sunlu/T3/Configuration_adv.h +++ b/config/examples/Sunlu/T3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/TPARA/AXEL_TPARA/Configuration_adv.h b/config/examples/TPARA/AXEL_TPARA/Configuration_adv.h index e6d881207b..42bbde2f87 100644 --- a/config/examples/TPARA/AXEL_TPARA/Configuration_adv.h +++ b/config/examples/TPARA/AXEL_TPARA/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Michelangelo/Configuration_adv.h b/config/examples/Tevo/Michelangelo/Configuration_adv.h index 227887a0b0..e0bc429009 100644 --- a/config/examples/Tevo/Michelangelo/Configuration_adv.h +++ b/config/examples/Tevo/Michelangelo/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Nereus/Configuration_adv.h b/config/examples/Tevo/Nereus/Configuration_adv.h index cc087f7029..f53fa211a1 100644 --- a/config/examples/Tevo/Nereus/Configuration_adv.h +++ b/config/examples/Tevo/Nereus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Tarantula Pro/MKS Gen_L/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/MKS Gen_L/Configuration_adv.h index 60fd4eac03..96c88b7d4b 100644 --- a/config/examples/Tevo/Tarantula Pro/MKS Gen_L/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/MKS Gen_L/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Tarantula Pro/MKS SGen_L/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/MKS SGen_L/Configuration_adv.h index 6322dafa21..647f792c58 100644 --- a/config/examples/Tevo/Tarantula Pro/MKS SGen_L/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/MKS SGen_L/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h index 95841d0f40..cda29797d6 100644 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tevo/Tornado/V2 (MKS Gen_L)/Configuration_adv.h b/config/examples/Tevo/Tornado/V2 (MKS Gen_L)/Configuration_adv.h index 95841d0f40..cda29797d6 100644 --- a/config/examples/Tevo/Tornado/V2 (MKS Gen_L)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V2 (MKS Gen_L)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tinkerine/Ditto Pro/RAMPS 1.4/Configuration_adv.h b/config/examples/Tinkerine/Ditto Pro/RAMPS 1.4/Configuration_adv.h index 6d32895d1b..ed8e5f7cfa 100644 --- a/config/examples/Tinkerine/Ditto Pro/RAMPS 1.4/Configuration_adv.h +++ b/config/examples/Tinkerine/Ditto Pro/RAMPS 1.4/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index 0f97368237..dd4ce2ef7e 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/D01/CXY-v6-191017 board/Configuration_adv.h b/config/examples/Tronxy/D01/CXY-v6-191017 board/Configuration_adv.h index 3c5ea39a1b..2a8ba15ae9 100644 --- a/config/examples/Tronxy/D01/CXY-v6-191017 board/Configuration_adv.h +++ b/config/examples/Tronxy/D01/CXY-v6-191017 board/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X1/Configuration_adv.h b/config/examples/Tronxy/X1/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Tronxy/X1/Configuration_adv.h +++ b/config/examples/Tronxy/X1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index 2d231b22c1..a091724a24 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X5S-2E/Green Board (Chitu V5)/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Green Board (Chitu V5)/Configuration_adv.h index b0f9c7a03b..79aea98ab2 100644 --- a/config/examples/Tronxy/X5S-2E/Green Board (Chitu V5)/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Green Board (Chitu V5)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X5S-2E/Red Board (Tronxy 3.1.0)/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Red Board (Tronxy 3.1.0)/Configuration_adv.h index eaeb5fc2dc..eaa916a69b 100644 --- a/config/examples/Tronxy/X5S-2E/Red Board (Tronxy 3.1.0)/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Red Board (Tronxy 3.1.0)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X5S/Configuration_adv.h b/config/examples/Tronxy/X5S/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Tronxy/X5S/Configuration_adv.h +++ b/config/examples/Tronxy/X5S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X5SA-2E/Configuration_adv.h b/config/examples/Tronxy/X5SA-2E/Configuration_adv.h index 5fe015506e..9ff70bc995 100644 --- a/config/examples/Tronxy/X5SA-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5SA-2E/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/X5SA/Configuration_adv.h b/config/examples/Tronxy/X5SA/Configuration_adv.h index 7832b6a875..5478cf8d2f 100644 --- a/config/examples/Tronxy/X5SA/Configuration_adv.h +++ b/config/examples/Tronxy/X5SA/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/XY100/Configuration_adv.h b/config/examples/Tronxy/XY100/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Tronxy/XY100/Configuration_adv.h +++ b/config/examples/Tronxy/XY100/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Tronxy/XY2-Pro/Configuration_adv.h b/config/examples/Tronxy/XY2-Pro/Configuration_adv.h index 8d4a896130..19ab02e5ba 100644 --- a/config/examples/Tronxy/XY2-Pro/Configuration_adv.h +++ b/config/examples/Tronxy/XY2-Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/BlueR Plus/Configuration_adv.h b/config/examples/Two Trees/BlueR Plus/Configuration_adv.h index 2b5edb7782..b5b81873a0 100644 --- a/config/examples/Two Trees/BlueR Plus/Configuration_adv.h +++ b/config/examples/Two Trees/BlueR Plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/BlueR/BlueR V1/Configuration_adv.h b/config/examples/Two Trees/BlueR/BlueR V1/Configuration_adv.h index 8eb4785a2d..e5d484fb67 100644 --- a/config/examples/Two Trees/BlueR/BlueR V1/Configuration_adv.h +++ b/config/examples/Two Trees/BlueR/BlueR V1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/BlueR/BlueR V2/Configuration_adv.h b/config/examples/Two Trees/BlueR/BlueR V2/Configuration_adv.h index 8eb4785a2d..e5d484fb67 100644 --- a/config/examples/Two Trees/BlueR/BlueR V2/Configuration_adv.h +++ b/config/examples/Two Trees/BlueR/BlueR V2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/BlueR/BlueR V3/Configuration_adv.h b/config/examples/Two Trees/BlueR/BlueR V3/Configuration_adv.h index 8eb4785a2d..e5d484fb67 100644 --- a/config/examples/Two Trees/BlueR/BlueR V3/Configuration_adv.h +++ b/config/examples/Two Trees/BlueR/BlueR V3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2.1/Configuration_adv.h b/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2.1/Configuration_adv.h index 9669d7e0bf..ef712a105f 100644 --- a/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2.1/Configuration_adv.h +++ b/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2.1/Configuration_adv.h @@ -1127,42 +1127,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2/Configuration_adv.h b/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2/Configuration_adv.h index 953dacfa2d..533856f7c6 100644 --- a/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2/Configuration_adv.h +++ b/config/examples/Two Trees/Sapphire Plus/Sapphire Plus V2/Configuration_adv.h @@ -1127,42 +1127,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Two Trees/Sapphire Pro/Configuration_adv.h b/config/examples/Two Trees/Sapphire Pro/Configuration_adv.h index 9c801cbd15..b830e50219 100644 --- a/config/examples/Two Trees/Sapphire Pro/Configuration_adv.h +++ b/config/examples/Two Trees/Sapphire Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index 173ee07884..4a52751da5 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index 8f64a1aac9..e2b2a70caf 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ultimaker/Ultimaker 2+/Configuration_adv.h b/config/examples/Ultimaker/Ultimaker 2+/Configuration_adv.h index 994049c9e8..2d41fbbf77 100644 --- a/config/examples/Ultimaker/Ultimaker 2+/Configuration_adv.h +++ b/config/examples/Ultimaker/Ultimaker 2+/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ultimaker/Ultimaker 2/Configuration_adv.h b/config/examples/Ultimaker/Ultimaker 2/Configuration_adv.h index de6d2833cf..e56790074b 100644 --- a/config/examples/Ultimaker/Ultimaker 2/Configuration_adv.h +++ b/config/examples/Ultimaker/Ultimaker 2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ultimaker/Ultimaker Original (1.5.7)/Configuration_adv.h b/config/examples/Ultimaker/Ultimaker Original (1.5.7)/Configuration_adv.h index 6ea27e3317..6f2d25be70 100644 --- a/config/examples/Ultimaker/Ultimaker Original (1.5.7)/Configuration_adv.h +++ b/config/examples/Ultimaker/Ultimaker Original (1.5.7)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ultimaker/Ultimaker Original Plus (2.1.1)/Configuration_adv.h b/config/examples/Ultimaker/Ultimaker Original Plus (2.1.1)/Configuration_adv.h index cfba15d648..45c4ae8f84 100644 --- a/config/examples/Ultimaker/Ultimaker Original Plus (2.1.1)/Configuration_adv.h +++ b/config/examples/Ultimaker/Ultimaker Original Plus (2.1.1)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Ultimaker/Ultimaker Original Plus DXU/Configuration_adv.h b/config/examples/Ultimaker/Ultimaker Original Plus DXU/Configuration_adv.h index 01b9780c73..bed8dbbed6 100644 --- a/config/examples/Ultimaker/Ultimaker Original Plus DXU/Configuration_adv.h +++ b/config/examples/Ultimaker/Ultimaker Original Plus DXU/Configuration_adv.h @@ -1119,42 +1119,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index d1458ab54e..01baabd8db 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Velleman/K8200 Upgraded/Configuration_adv.h b/config/examples/Velleman/K8200 Upgraded/Configuration_adv.h index c0466585e2..c03f2906be 100644 --- a/config/examples/Velleman/K8200 Upgraded/Configuration_adv.h +++ b/config/examples/Velleman/K8200 Upgraded/Configuration_adv.h @@ -1134,42 +1134,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 26481b5168..7cd46d3a19 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -1134,42 +1134,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h index 193e30f038..8cb6da977d 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Velleman/K8400/Single-head/Configuration_adv.h b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h index 193e30f038..8cb6da977d 100644 --- a/config/examples/Velleman/K8400/Single-head/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Voxelab/Aquila/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h b/config/examples/Voxelab/Aquila/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h index d9dfa66d1c..6a2ff1a611 100644 --- a/config/examples/Voxelab/Aquila/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h +++ b/config/examples/Voxelab/Aquila/BigTreeTech SKR Mini E3 2.0/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index 15a815cec9..d33bb675d3 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Wanhao/Duplicator 4S/Configuration_adv.h b/config/examples/Wanhao/Duplicator 4S/Configuration_adv.h index 62ae51fcba..f001c0be38 100644 --- a/config/examples/Wanhao/Duplicator 4S/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 4S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 0bfcd73e9a..92d67cf896 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h index f857886933..187a5975e3 100644 --- a/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h index 7a87921ad1..290d4d9ca3 100644 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Wanhao/Duplicator i3 Plus/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Plus/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/Wanhao/Duplicator i3 Plus/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 Plus/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Weedo/Tina2/V2/Configuration_adv.h b/config/examples/Weedo/Tina2/V2/Configuration_adv.h index e5dc391a4f..117044ea33 100644 --- a/config/examples/Weedo/Tina2/V2/Configuration_adv.h +++ b/config/examples/Weedo/Tina2/V2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Weedo/Tina2/V3/Configuration_adv.h b/config/examples/Weedo/Tina2/V3/Configuration_adv.h index e5dc391a4f..117044ea33 100644 --- a/config/examples/Weedo/Tina2/V3/Configuration_adv.h +++ b/config/examples/Weedo/Tina2/V3/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Weistek/wt150/Configuration_adv.h b/config/examples/Weistek/wt150/Configuration_adv.h index c4d1d7a614..02bedcf318 100644 --- a/config/examples/Weistek/wt150/Configuration_adv.h +++ b/config/examples/Weistek/wt150/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Zonestar/P802M/Configuration_adv.h b/config/examples/Zonestar/P802M/Configuration_adv.h index befe379562..dbe6d7bb51 100644 --- a/config/examples/Zonestar/P802M/Configuration_adv.h +++ b/config/examples/Zonestar/P802M/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (A4988)/Configuration_adv.h b/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (A4988)/Configuration_adv.h index d5fb48535d..2d272a855b 100644 --- a/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (A4988)/Configuration_adv.h +++ b/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (A4988)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (TMC2209)/Configuration_adv.h b/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (TMC2209)/Configuration_adv.h index 87bc6221e0..e6bb3f7a9a 100755 --- a/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (TMC2209)/Configuration_adv.h +++ b/config/examples/Zonestar/P802QR2/BigTreeTech SKR 1.4 Turbo (TMC2209)/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Anycubic/Kossel Linear Plus/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel Linear Plus/Configuration_adv.h index bf1899162c..b032d8ea4d 100644 --- a/config/examples/delta/Anycubic/Kossel Linear Plus/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel Linear Plus/Configuration_adv.h @@ -1122,42 +1122,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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index d38225898d..75a1391864 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Anycubic/Predator/Configuration_adv.h b/config/examples/delta/Anycubic/Predator/Configuration_adv.h index ac8fae4cf9..f01787244b 100644 --- a/config/examples/delta/Anycubic/Predator/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Predator/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h index 1d503e0f5d..e1c332689f 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h index 1d503e0f5d..e1c332689f 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/Q5-nano_v1/Configuration_adv.h b/config/examples/delta/FLSUN/Q5-nano_v1/Configuration_adv.h index e26e5d8105..1a7877ef97 100644 --- a/config/examples/delta/FLSUN/Q5-nano_v1/Configuration_adv.h +++ b/config/examples/delta/FLSUN/Q5-nano_v1/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/Q5-nano_v2/Configuration_adv.h b/config/examples/delta/FLSUN/Q5-nano_v2/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/delta/FLSUN/Q5-nano_v2/Configuration_adv.h +++ b/config/examples/delta/FLSUN/Q5-nano_v2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h index 91ebcf3054..1b7a679619 100644 --- a/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h +++ b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/QQS-Pro/Configuration_adv.h b/config/examples/delta/FLSUN/QQS-Pro/Configuration_adv.h index 26050d663a..5d30ba3b88 100644 --- a/config/examples/delta/FLSUN/QQS-Pro/Configuration_adv.h +++ b/config/examples/delta/FLSUN/QQS-Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index e5f2cc033d..cfa272c0eb 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index e5f2cc033d..cfa272c0eb 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index c545a35672..5998db0969 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Geeetech/G2/Configuration_adv.h b/config/examples/delta/Geeetech/G2/Configuration_adv.h index 3d0d68c0b4..d3c3b5799e 100644 --- a/config/examples/delta/Geeetech/G2/Configuration_adv.h +++ b/config/examples/delta/Geeetech/G2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h b/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h index 3d0d68c0b4..d3c3b5799e 100644 --- a/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h +++ b/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Geeetech/G2S/Configuration_adv.h b/config/examples/delta/Geeetech/G2S/Configuration_adv.h index 3d0d68c0b4..d3c3b5799e 100644 --- a/config/examples/delta/Geeetech/G2S/Configuration_adv.h +++ b/config/examples/delta/Geeetech/G2S/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Geeetech/G2SPro/Configuration_adv.h b/config/examples/delta/Geeetech/G2SPro/Configuration_adv.h index 3d0d68c0b4..d3c3b5799e 100644 --- a/config/examples/delta/Geeetech/G2SPro/Configuration_adv.h +++ b/config/examples/delta/Geeetech/G2SPro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index b4e6328434..1a9c6f393e 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Hatchbox_Alpha/Configuration_adv.h b/config/examples/delta/Hatchbox_Alpha/Configuration_adv.h index 86cf016f0d..9b48cb220f 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration_adv.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index 00190f227c..3318c83072 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Malyan M300/Configuration_adv.h b/config/examples/delta/Malyan M300/Configuration_adv.h index a21366cf51..fe2b6bad2c 100644 --- a/config/examples/delta/Malyan M300/Configuration_adv.h +++ b/config/examples/delta/Malyan M300/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 85c961fcd9..59949095ca 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/Velleman/K8800/Configuration_adv.h b/config/examples/delta/Velleman/K8800/Configuration_adv.h index 7216781d41..2dc8ef7ff1 100644 --- a/config/examples/delta/Velleman/K8800/Configuration_adv.h +++ b/config/examples/delta/Velleman/K8800/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index c545a35672..5998db0969 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/kossel_clear/Configuration_adv.h b/config/examples/delta/kossel_clear/Configuration_adv.h index aa2f54f89c..d3600b8bff 100644 --- a/config/examples/delta/kossel_clear/Configuration_adv.h +++ b/config/examples/delta/kossel_clear/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/kossel_pro/Configuration_adv.h b/config/examples/delta/kossel_pro/Configuration_adv.h index b1d97a56f2..2883b0ac22 100644 --- a/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/config/examples/delta/kossel_pro/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index 483bd659c6..4cf4fa85c6 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 7dcf7442c3..2e892cd90b 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/linear_axes/Octopus 8 LINEAR_AXES/Configuration_adv.h b/config/examples/linear_axes/Octopus 8 LINEAR_AXES/Configuration_adv.h index db4816bb5f..477195d8d4 100644 --- a/config/examples/linear_axes/Octopus 8 LINEAR_AXES/Configuration_adv.h +++ b/config/examples/linear_axes/Octopus 8 LINEAR_AXES/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/linear_axes/RAMPS 5 LINEAR_AXES/Configuration_adv.h b/config/examples/linear_axes/RAMPS 5 LINEAR_AXES/Configuration_adv.h index d2b6a0e0be..0a94524ed9 100644 --- a/config/examples/linear_axes/RAMPS 5 LINEAR_AXES/Configuration_adv.h +++ b/config/examples/linear_axes/RAMPS 5 LINEAR_AXES/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index afcc32cd97..b90c73e83f 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /** diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index da240f7e6b..55eae94e17 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -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(). + #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 - // 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 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) - //#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters. + // 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 /**