diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0c968f6db..2a1115600 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1b3c0c218..e8c09fcbf 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5548,11 +5548,11 @@ inline void gcode_M92() { float value = code_value_per_axis_unit(i); if (value < 20.0) { float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab. - planner.max_e_jerk *= factor; - planner.max_feedrate_mm_s[i] *= factor; - planner.max_acceleration_steps_per_s2[i] *= factor; + planner.max_jerk[E_AXIS] *= factor; + planner.max_feedrate_mm_s[E_AXIS] *= factor; + planner.max_acceleration_steps_per_s2[E_AXIS] *= factor; } - planner.axis_steps_per_mm[i] = value; + planner.axis_steps_per_mm[E_AXIS] = value; } else { planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i); @@ -5788,9 +5788,10 @@ inline void gcode_M205() { if (code_seen('S')) planner.min_feedrate_mm_s = code_value_linear_units(); if (code_seen('T')) planner.min_travel_feedrate_mm_s = code_value_linear_units(); if (code_seen('B')) planner.min_segment_time = code_value_millis(); - if (code_seen('X')) planner.max_xy_jerk = code_value_linear_units(); - if (code_seen('Z')) planner.max_z_jerk = code_value_axis_units(Z_AXIS); - if (code_seen('E')) planner.max_e_jerk = code_value_axis_units(E_AXIS); + if (code_seen('X')) planner.max_jerk[X_AXIS] = code_value_axis_units(X_AXIS); + if (code_seen('Y')) planner.max_jerk[Y_AXIS] = code_value_axis_units(Y_AXIS); + if (code_seen('Z')) planner.max_jerk[Z_AXIS] = code_value_axis_units(Z_AXIS); + if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_axis_units(E_AXIS); } /** diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b2c9bfc54..44950ffdf 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -91,6 +91,8 @@ #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." +#elif defined(DEFAULT_XYJERK) + #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." #elif defined(XY_TRAVEL_SPEED) #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." #elif defined(PROBE_SERVO_DEACTIVATION_DELAY) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index f6d061dcb..1891651f6 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -36,7 +36,7 @@ * */ -#define EEPROM_VERSION "V25" +#define EEPROM_VERSION "V26" // Change EEPROM version if these are changed: #define EEPROM_OFFSET 100 @@ -57,69 +57,70 @@ * 166 M205 S planner.min_feedrate_mm_s (float) * 170 M205 T planner.min_travel_feedrate_mm_s (float) * 174 M205 B planner.min_segment_time (ulong) - * 178 M205 X planner.max_xy_jerk (float) - * 182 M205 Z planner.max_z_jerk (float) - * 186 M205 E planner.max_e_jerk (float) - * 190 M206 XYZ home_offset (float x3) + * 178 M205 X planner.max_jerk[X_AXIS] (float) + * 182 M205 Y planner.max_jerk[Y_AXIS] (float) + * 186 M205 Z planner.max_jerk[Z_AXIS] (float) + * 190 M205 E planner.max_jerk[E_AXIS] (float) + * 194 M206 XYZ home_offset (float x3) * * Mesh bed leveling: - * 202 M420 S status (uint8) - * 203 z_offset (float) - * 207 mesh_num_x (uint8 as set in firmware) - * 208 mesh_num_y (uint8 as set in firmware) - * 209 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) + * 206 M420 S status (uint8) + * 207 z_offset (float) + * 211 mesh_num_x (uint8 as set in firmware) + * 212 mesh_num_y (uint8 as set in firmware) + * 213 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) * * AUTO BED LEVELING - * 245 M851 zprobe_zoffset (float) + * 249 M851 zprobe_zoffset (float) * * DELTA: - * 249 M666 XYZ endstop_adj (float x3) - * 261 M665 R delta_radius (float) - * 265 M665 L delta_diagonal_rod (float) - * 269 M665 S delta_segments_per_second (float) - * 273 M665 A delta_diagonal_rod_trim_tower_1 (float) - * 277 M665 B delta_diagonal_rod_trim_tower_2 (float) - * 281 M665 C delta_diagonal_rod_trim_tower_3 (float) + * 253 M666 XYZ endstop_adj (float x3) + * 265 M665 R delta_radius (float) + * 269 M665 L delta_diagonal_rod (float) + * 273 M665 S delta_segments_per_second (float) + * 277 M665 A delta_diagonal_rod_trim_tower_1 (float) + * 281 M665 B delta_diagonal_rod_trim_tower_2 (float) + * 285 M665 C delta_diagonal_rod_trim_tower_3 (float) * * Z_DUAL_ENDSTOPS: - * 285 M666 Z z_endstop_adj (float) + * 289 M666 Z z_endstop_adj (float) * * ULTIPANEL: - * 289 M145 S0 H preheatHotendTemp1 (int) - * 291 M145 S0 B preheatBedTemp1 (int) - * 293 M145 S0 F preheatFanSpeed1 (int) - * 295 M145 S1 H preheatHotendTemp2 (int) - * 297 M145 S1 B preheatBedTemp2 (int) - * 299 M145 S1 F preheatFanSpeed2 (int) + * 293 M145 S0 H preheatHotendTemp1 (int) + * 295 M145 S0 B preheatBedTemp1 (int) + * 297 M145 S0 F preheatFanSpeed1 (int) + * 299 M145 S1 H preheatHotendTemp2 (int) + * 301 M145 S1 B preheatBedTemp2 (int) + * 303 M145 S1 F preheatFanSpeed2 (int) * * PIDTEMP: - * 301 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) - * 317 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) - * 333 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) - * 349 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) - * 365 M301 L lpq_len (int) + * 305 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) + * 321 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) + * 337 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) + * 353 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 369 M301 L lpq_len (int) * * PIDTEMPBED: - * 367 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3) + * 371 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3) * * DOGLCD: - * 379 M250 C lcd_contrast (int) + * 383 M250 C lcd_contrast (int) * * FWRETRACT: - * 381 M209 S autoretract_enabled (bool) - * 382 M207 S retract_length (float) - * 386 M207 W retract_length_swap (float) - * 390 M207 F retract_feedrate_mm_s (float) - * 394 M207 Z retract_zlift (float) - * 398 M208 S retract_recover_length (float) - * 402 M208 W retract_recover_length_swap (float) - * 406 M208 F retract_recover_feedrate_mm_s (float) + * 385 M209 S autoretract_enabled (bool) + * 386 M207 S retract_length (float) + * 390 M207 W retract_length_swap (float) + * 394 M207 F retract_feedrate_mm_s (float) + * 399 M207 Z retract_zlift (float) + * 402 M208 S retract_recover_length (float) + * 406 M208 W retract_recover_length_swap (float) + * 410 M208 F retract_recover_feedrate_mm_s (float) * * Volumetric Extrusion: - * 410 M200 D volumetric_enabled (bool) - * 411 M200 T D filament_size (float x4) (T0..3) + * 414 M200 D volumetric_enabled (bool) + * 415 M200 T D filament_size (float x4) (T0..3) * - * 427 This Slot is Available! + * 431 This Slot is Available! * */ #include "Marlin.h" @@ -219,9 +220,7 @@ void Config_StoreSettings() { EEPROM_WRITE(planner.min_feedrate_mm_s); EEPROM_WRITE(planner.min_travel_feedrate_mm_s); EEPROM_WRITE(planner.min_segment_time); - EEPROM_WRITE(planner.max_xy_jerk); - EEPROM_WRITE(planner.max_z_jerk); - EEPROM_WRITE(planner.max_e_jerk); + EEPROM_WRITE(planner.max_jerk); EEPROM_WRITE(home_offset); #if ENABLED(MESH_BED_LEVELING) @@ -405,9 +404,7 @@ void Config_RetrieveSettings() { EEPROM_READ(planner.min_feedrate_mm_s); EEPROM_READ(planner.min_travel_feedrate_mm_s); EEPROM_READ(planner.min_segment_time); - EEPROM_READ(planner.max_xy_jerk); - EEPROM_READ(planner.max_z_jerk); - EEPROM_READ(planner.max_e_jerk); + EEPROM_READ(planner.max_jerk); EEPROM_READ(home_offset); uint8_t dummy_uint8 = 0, mesh_num_x = 0, mesh_num_y = 0; @@ -576,9 +573,10 @@ void Config_ResetDefault() { planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; planner.min_segment_time = DEFAULT_MINSEGMENTTIME; planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; - planner.max_xy_jerk = DEFAULT_XYJERK; - planner.max_z_jerk = DEFAULT_ZJERK; - planner.max_e_jerk = DEFAULT_EJERK; + planner.max_jerk[X_AXIS] = DEFAULT_XJERK; + planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; + planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; + planner.max_jerk[E_AXIS] = DEFAULT_EJERK; home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0; #if ENABLED(MESH_BED_LEVELING) @@ -734,9 +732,10 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate_mm_s); SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s); SERIAL_ECHOPAIR(" B", planner.min_segment_time); - SERIAL_ECHOPAIR(" X", planner.max_xy_jerk); - SERIAL_ECHOPAIR(" Z", planner.max_z_jerk); - SERIAL_ECHOPAIR(" E", planner.max_e_jerk); + SERIAL_ECHOPAIR(" X", planner.max_jerk[X_AXIS]); + SERIAL_ECHOPAIR(" Y", planner.max_jerk[Y_AXIS]); + SERIAL_ECHOPAIR(" Z", planner.max_jerk[Z_AXIS]); + SERIAL_ECHOPAIR(" E", planner.max_jerk[E_AXIS]); SERIAL_EOL; CONFIG_ECHO_START; diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 883cdc784..318e15d3f 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2ef68d97c..d5940affd 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -481,7 +481,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 0b5facb68..6f39cf5d7 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -481,7 +481,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index ad5c8201f..d461704d6 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -490,7 +490,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 3eb08e2ba..945425eb1 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -492,7 +492,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 2.0 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 5c5c3ec30..f9c1aad8d 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -515,7 +515,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index d3d9d5f5b..93693baaf 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.5 #define DEFAULT_EJERK 20.0 diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 097d1775f..138651faf 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.5 #define DEFAULT_EJERK 20.0 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 289a672cb..b08323e6b 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 400caaf96..419e1abf9 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -496,7 +496,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 8.0 +#define DEFAULT_XJERK 8.0 +#define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index a9eb8b51e..9768a2309 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -513,7 +513,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 5.0 +#define DEFAULT_XJERK 5.0 +#define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 3.0 diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 3d60ca679..9ec1e6e37 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -519,7 +519,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 8.0 +#define DEFAULT_XJERK 8.0 +#define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 10.0 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index be796c38a..9c9a0aa8f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -490,7 +490,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 10.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 6485659c5..d7e4535b5 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -498,7 +498,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 154fa773b..e6bd25c27 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -541,7 +541,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 15.0 +#define DEFAULT_XJERK 15.0 +#define DEFAULT_YJERK 15.0 #define DEFAULT_ZJERK 15.0 // Must be same as XY for delta #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8c786f4c5..0bafa2b57 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -541,7 +541,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 20.0 // Must be same as XY for delta #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b34025fd5..1994e9020 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -541,7 +541,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 20.0 // Must be same as XY for delta #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 72b832c54..5ce3bb4d0 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -537,7 +537,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 20.0 // Must be same as XY for delta #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 77091bb2c..27f2a968d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -547,7 +547,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 20.0 #define DEFAULT_EJERK 20.0 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f03067f4d..8c202ae8e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -501,7 +501,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4c90e6688..e356a50da 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -494,7 +494,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XYJERK 20.0 +#define DEFAULT_XJERK 20.0 +#define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 9184d332f..8d6ccd944 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -86,7 +86,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ves-jerk" #define MSG_VMAX "Vmax" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 5d5d3222c..094aed0d3 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -88,7 +88,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index efa296f9b..8bb97060a 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -87,7 +87,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Accel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 9afc052d7..1a1f81313 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -86,7 +86,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Accel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 89158e7e4..7a441a429 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -98,7 +98,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "Vybrat" #define MSG_ACC "Zrychl" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 2cf28dec4..8c770920d 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -96,7 +96,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "Vælg" #define MSG_ACC "Accel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_de.h b/Marlin/language_de.h index f291a5d2a..2bc8a8d47 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -95,9 +95,10 @@ #define MSG_PID_C "PID C" #define MSG_SELECT "Auswählen" #define MSG_ACC "A" -#define MSG_VXY_JERK "V XY Jerk" -#define MSG_VZ_JERK "V Z Jerk" -#define MSG_VE_JERK "V E Jerk" +#define MSG_VX_JERK "V X Jerk" +#define MSG_VY_JERK "V Y Jerk" +#define MSG_VZ_JERK "V Z Jerk" +#define MSG_VE_JERK "V E Jerk" #define MSG_VMAX "V max " // space by purpose #define MSG_VMIN "V min" #define MSG_VTRAV_MIN "V min Leerfahrt" diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h index 1c1849669..0ac443f55 100644 --- a/Marlin/language_el-gr.h +++ b/Marlin/language_el-gr.h @@ -94,7 +94,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Επιτάχυνση" -#define MSG_VXY_JERK "Vαντίδραση xy" +#define MSG_VX_JERK "Vαντίδραση x" +#define MSG_VY_JERK "Vαντίδραση y" #define MSG_VZ_JERK "Vαντίδραση z" #define MSG_VE_JERK "Vαντίδραση e" #define MSG_VMAX "Vμεγ " diff --git a/Marlin/language_el.h b/Marlin/language_el.h index 424296979..03b45c3e2 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -94,7 +94,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Επιτάχυνση" -#define MSG_VXY_JERK "Vαντίδραση xy" +#define MSG_VX_JERK "Vαντίδραση x" +#define MSG_VY_JERK "Vαντίδραση y" #define MSG_VZ_JERK "Vαντίδραση z" #define MSG_VE_JERK "Vαντίδραση e" #define MSG_VMAX "V Μέγιστο" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index ca2fd6117..aa11a1325 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -216,8 +216,11 @@ #ifndef MSG_ACC #define MSG_ACC "Accel" #endif -#ifndef MSG_VXY_JERK - #define MSG_VXY_JERK "Vxy-jerk" +#ifndef MSG_VX_JERK + #define MSG_VX_JERK "Vx-jerk" +#endif +#ifndef MSG_VY_JERK + #define MSG_VY_JERK "Vy-jerk" #endif #ifndef MSG_VZ_JERK #define MSG_VZ_JERK "Vz-jerk" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 06d79f707..236842d75 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -92,7 +92,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Aceleracion" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 64c3fb32a..0d663597f 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -86,7 +86,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Azelerazioa" -#define MSG_VXY_JERK "Vxy-astindua" +#define MSG_VX_JERK "Vx-astindua" +#define MSG_VY_JERK "Vy-astindua" #define MSG_VZ_JERK "Vz-astindua" #define MSG_VE_JERK "Ve-astindua" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 461bb413c..e7db9a2d9 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -87,7 +87,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Kiihtyv" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 34bd38364..8a947dabb 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -94,7 +94,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "Selectionner" #define MSG_ACC "Acceleration" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax" diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 5f1b591e9..19b028b6d 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -95,7 +95,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "Escolla" #define MSG_ACC "Acel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index ebfaeb2fb..d23e18e85 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -93,7 +93,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Accel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_it.h b/Marlin/language_it.h index e3a253c86..75df0efde 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -102,7 +102,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "Seleziona" #define MSG_ACC "Accel" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index f4e145852..add301b97 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -103,7 +103,8 @@ #define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select") #if LCD_WIDTH > 19 #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") - #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vxy-jerk") + #define MSG_VX_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vx-jerk") + #define MSG_VY_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vy-jerk") #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk") #define MSG_VE_JERK "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\x20\xd4\xb8\xc4\xde" // "エクストルーダー ヤクド" ("Ve-jerk") #define MSG_VMAX "\xbb\xb2\xc0\xde\xb2\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "サイダイオクリソクド " ("Vmax ") @@ -112,7 +113,8 @@ #define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ") #else #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") - #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vxy-jerk") + #define MSG_VX_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vx-jerk") + #define MSG_VY_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vy-jerk") #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk") #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 905df7142..15712fd8c 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -100,7 +100,8 @@ #define MSG_PID_C "PID-C" #define MSG_SELECT "センタク" // "Select" #define MSG_ACC "カソクド mm/s2" // "Accel" -#define MSG_VXY_JERK "XYジク ヤクド mm/s" // "Vxy-jerk" +#define MSG_VX_JERK "Xジク ヤクド mm/s" // "Vx-jerk" +#define MSG_VY_JERK "Yジク ヤクド mm/s" // "Vy-jerk" #define MSG_VZ_JERK "Zジク ヤクド mm/s" // "Vz-jerk" #define MSG_VE_JERK "エクストルーダー ヤクド" // "Ve-jerk" #define MSG_VMAX "サイダイオクリソクド " // "Vmax " diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 82f0a69b8..f21ece830 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -87,7 +87,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Versn" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index efde140b9..61129aeec 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -90,7 +90,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Przyspieszenie" -#define MSG_VXY_JERK "Zryw Vxy" +#define MSG_VX_JERK "Zryw Vx" +#define MSG_VY_JERK "Zryw Vy" #define MSG_VZ_JERK "Zryw Vz" #define MSG_VE_JERK "Zryw Ve" #define MSG_VMAX "Vmax " diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 1db6ae6a1..fe5b834fd 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -87,7 +87,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "jogo VXY" +#define MSG_VX_JERK "jogo VX" +#define MSG_VY_JERK "jogo VY" #define MSG_VZ_JERK "jogo VZ" #define MSG_VE_JERK "jogo VE" #define MSG_VMAX " Vmax " diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index 43e5d549b..7fb411740 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -87,7 +87,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "jogo VXY" +#define MSG_VX_JERK "jogo VX" +#define MSG_VY_JERK "jogo VY" #define MSG_VZ_JERK "jogo VZ" #define MSG_VE_JERK "jogo VE" #define MSG_VMAX " Vmax " diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 5996dd12a..d73af9ea5 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -91,7 +91,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX " Vmax " diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index ec56a86cc..536896b1d 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -91,7 +91,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX " Vmax " diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 7fb0e1055..7441f34ca 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -91,7 +91,8 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_VXY_JERK "Vxy-рывок" +#define MSG_VX_JERK "Vx-рывок" +#define MSG_VY_JERK "Vy-рывок" #define MSG_VZ_JERK "Vz-рывок" #define MSG_VE_JERK "Ve-рывок" #define MSG_VMAX "Vмакс " diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 2d4cd107e..6e694771d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -93,9 +93,7 @@ float Planner::min_feedrate_mm_s, Planner::acceleration, // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX Planner::travel_acceleration, // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX - Planner::max_xy_jerk, // The largest speed change requiring no acceleration - Planner::max_z_jerk, - Planner::max_e_jerk, + Planner::max_jerk[XYZE], // The largest speed change requiring no acceleration Planner::min_travel_feedrate_mm_s; #if HAS_ABL @@ -1101,30 +1099,26 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co #endif // Start with a safe speed - float vmax_junction = max_xy_jerk * 0.5, - vmax_junction_factor = 1.0, - mz2 = max_z_jerk * 0.5, - me2 = max_e_jerk * 0.5, - csz = current_speed[Z_AXIS], - cse = current_speed[E_AXIS]; - if (fabs(csz) > mz2) vmax_junction = min(vmax_junction, mz2); - if (fabs(cse) > me2) vmax_junction = min(vmax_junction, me2); - vmax_junction = min(vmax_junction, block->nominal_speed); + float vmax_junction = max_jerk[X_AXIS] * 0.5, vmax_junction_factor = 1.0; + if (max_jerk[Y_AXIS] * 0.5 < fabs(current_speed[Y_AXIS])) NOMORE(vmax_junction, max_jerk[Y_AXIS] * 0.5); + if (max_jerk[Z_AXIS] * 0.5 < fabs(current_speed[Z_AXIS])) NOMORE(vmax_junction, max_jerk[Z_AXIS] * 0.5); + if (max_jerk[E_AXIS] * 0.5 < fabs(current_speed[E_AXIS])) NOMORE(vmax_junction, max_jerk[E_AXIS] * 0.5); + NOMORE(vmax_junction, block->nominal_speed); float safe_speed = vmax_junction; - if ((moves_queued > 1) && (previous_nominal_speed > 0.0001)) { - float dsx = current_speed[X_AXIS] - previous_speed[X_AXIS], - dsy = current_speed[Y_AXIS] - previous_speed[Y_AXIS], - dsz = fabs(csz - previous_speed[Z_AXIS]), - dse = fabs(cse - previous_speed[E_AXIS]), - jerk = HYPOT(dsx, dsy); + if (moves_queued > 1 && previous_nominal_speed > 0.0001) { + //if ((fabs(previous_speed[X_AXIS]) > 0.0001) || (fabs(previous_speed[Y_AXIS]) > 0.0001)) { + vmax_junction = block->nominal_speed; + //} - // if ((fabs(previous_speed[X_AXIS]) > 0.0001) || (fabs(previous_speed[Y_AXIS]) > 0.0001)) { - vmax_junction = block->nominal_speed; - // } - if (jerk > max_xy_jerk) vmax_junction_factor = max_xy_jerk / jerk; - if (dsz > max_z_jerk) vmax_junction_factor = min(vmax_junction_factor, max_z_jerk / dsz); - if (dse > max_e_jerk) vmax_junction_factor = min(vmax_junction_factor, max_e_jerk / dse); + float dsx = fabs(current_speed[X_AXIS] - previous_speed[X_AXIS]), + dsy = fabs(current_speed[Y_AXIS] - previous_speed[Y_AXIS]), + dsz = fabs(current_speed[Z_AXIS] - previous_speed[Z_AXIS]), + dse = fabs(current_speed[E_AXIS] - previous_speed[E_AXIS]); + if (dsx > max_jerk[X_AXIS]) NOMORE(vmax_junction_factor, max_jerk[X_AXIS] / dsx); + if (dsy > max_jerk[Y_AXIS]) NOMORE(vmax_junction_factor, max_jerk[Y_AXIS] / dsy); + if (dsz > max_jerk[Z_AXIS]) NOMORE(vmax_junction_factor, max_jerk[Z_AXIS] / dsz); + if (dse > max_jerk[E_AXIS]) NOMORE(vmax_junction_factor, max_jerk[E_AXIS] / dse); vmax_junction = min(previous_nominal_speed, vmax_junction * vmax_junction_factor); // Limit speed to max previous speed } @@ -1173,7 +1167,7 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co } else { long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2); - float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(cse, EXTRUSION_AREA) * 256; + float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(current_speed[E_AXIS], EXTRUSION_AREA) * 256; block->advance = advance; block->advance_rate = acc_dist ? advance / (float)acc_dist : 0; } diff --git a/Marlin/planner.h b/Marlin/planner.h index c198f083a..0e95be4cd 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -132,9 +132,7 @@ class Planner { static float acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX static float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX static float travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX - static float max_xy_jerk; // The largest speed change requiring no acceleration - static float max_z_jerk; - static float max_e_jerk; + static float max_jerk[XYZE]; // The largest speed change requiring no acceleration static float min_travel_feedrate_mm_s; #if HAS_ABL diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index da5440c5d..884c6442b 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1812,13 +1812,14 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); #endif MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); - MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &planner.max_xy_jerk, 1, 990); + MENU_ITEM_EDIT(float3, MSG_VX_JERK, &planner.max_jerk[X_AXIS], 1, 990); + MENU_ITEM_EDIT(float3, MSG_VY_JERK, &planner.max_jerk[Y_AXIS], 1, 990); #if ENABLED(DELTA) - MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_z_jerk, 1, 990); + MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_jerk[Y_AXIS], 1, 990); #else - MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990); + MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_jerk[Z_AXIS], 0.1, 990); #endif - MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990); + MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999);