From 4c3504c43f0ecd74b5838ff2baed05806f9f4294 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jun 2018 18:17:41 -0500 Subject: [PATCH] Limit Junction Deviation (0.01 to 0.3) --- Marlin/Marlin_main.cpp | 10 +++++++++- Marlin/ultralcd.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 571d59f4dd..0d2e7c1565 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9138,7 +9138,15 @@ inline void gcode_M205() { if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units(); #if ENABLED(JUNCTION_DEVIATION) - if (parser.seen('J')) planner.junction_deviation_mm = parser.value_linear_units(); + if (parser.seen('J')) { + const float junc_dev = parser.value_linear_units(); + if (WITHIN(junc_dev, 0.01, 0.3)) + planner.junction_deviation_mm = junc_dev; + else { + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)"); + } + } #else if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units(); if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units(); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 967aa6cbb7..cb2dbf7261 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -3743,7 +3743,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_BACK(MSG_MOTION); #if ENABLED(JUNCTION_DEVIATION) - MENU_ITEM_EDIT(float3, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0, 5); + MENU_ITEM_EDIT(float3, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01, 0.3); #else MENU_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); MENU_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990);