From 8a4376d51f07a93308a7e0aa4ba25eca955e25b6 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 14 May 2016 00:29:13 +0200 Subject: [PATCH] Idle during long arcs Idle during long arcs to prevent from watchdog resets during high segmented fast arcs. --- Marlin/Marlin_main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 26a9823e8..f9cd80783 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6488,7 +6488,7 @@ void process_next_command() { break; // G2, G3 - #if ENABLED(ARC_SUPPORT) & DISABLED(SCARA) + #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) case 2: // G2 - CW ARC case 3: // G3 - CCW ARC gcode_G2_G3(codenum == 2); @@ -7514,8 +7514,16 @@ void prepare_move() { float feed_rate = feedrate * feedrate_multiplier / 60 / 100.0; + millis_t previous_ms = millis(); + for (i = 1; i < segments; i++) { // Iterate (segments-1) times + millis_t now = millis(); + if (now - previous_ms > 200UL) { + previous_ms = now; + idle(); + } + if (++count < N_ARC_CORRECTION) { // Apply vector rotation matrix to previous r_X / 1 r_new_Y = r_X * sin_T + r_Y * cos_T;