From 87d744995271945b814d9f4c84d3b791422c0c50 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Feb 2023 19:39:21 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Use=20'M205=20D'=20when=20'B'=20?= =?UTF-8?q?is=20an=20axis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/config/M200-M205.cpp | 45 +++++++++++++++++---------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 87c1f2ce30..cda3177d93 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -221,9 +221,9 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) { /** * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) * - * P = Printing moves - * R = Retract only (no X, Y, Z) moves - * T = Travel (non printing) moves + * P Printing moves + * R Retract only (no X, Y, Z) moves + * T Travel (non printing) moves */ void GcodeSuite::M204() { if (!parser.seen("PRST")) @@ -247,24 +247,37 @@ void GcodeSuite::M204_report(const bool forReplay/*=true*/) { ); } +#if AXIS_COLLISION('B') + #define M205_MIN_SEG_TIME_PARAM 'D' + #define M205_MIN_SEG_TIME_STR "D" + #warning "Use 'M205 D' for Minimum Segment Time." +#else + #define M205_MIN_SEG_TIME_PARAM 'B' + #define M205_MIN_SEG_TIME_STR "B" +#endif + /** * M205: Set Advanced Settings * - * B = Min Segment Time (µs) - * S = Min Feed Rate (units/s) - * T = Min Travel Feed Rate (units/s) - * X = Max X Jerk (units/sec^2) - * Y = Max Y Jerk (units/sec^2) - * Z = Max Z Jerk (units/sec^2) - * E = Max E Jerk (units/sec^2) - * J = Junction Deviation (mm) (If not using CLASSIC_JERK) + * B<µs> : Min Segment Time + * S : Min Feed Rate + * T : Min Travel Feed Rate + * + * With CLASSIC_JERK: + * X : Max X Jerk + * Y : Max Y Jerk + * Z : Max Z Jerk + * ... : etc + * E : Max E Jerk + * + * Without CLASSIC_JERK: + * J(mm) : Junction Deviation */ void GcodeSuite::M205() { - if (!parser.seen("BST" TERN_(HAS_JUNCTION_DEVIATION, "J") TERN_(HAS_CLASSIC_JERK, "XYZE"))) - return M205_report(); + if (!parser.seen_any()) return M205_report(); //planner.synchronize(); - if (parser.seenval('B')) planner.settings.min_segment_time_us = parser.value_ulong(); + if (parser.seenval(M205_MIN_SEG_TIME_PARAM)) planner.settings.min_segment_time_us = parser.value_ulong(); if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units(); #if HAS_JUNCTION_DEVIATION @@ -304,7 +317,7 @@ void GcodeSuite::M205() { void GcodeSuite::M205_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F( - "Advanced (B S T" + "Advanced (" M205_MIN_SEG_TIME_STR " S T" TERN_(HAS_JUNCTION_DEVIATION, " J") #if HAS_CLASSIC_JERK NUM_AXIS_GANG( @@ -317,7 +330,7 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) { ")" )); SERIAL_ECHOLNPGM_P( - PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us) + PSTR(" M205 " M205_MIN_SEG_TIME_STR), LINEAR_UNIT(planner.settings.min_segment_time_us) , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s) , SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) #if HAS_JUNCTION_DEVIATION