From b3af9708e9aeff98fbe0af8793a900430356ace4 Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Thu, 24 Jan 2019 16:50:34 +0100 Subject: [PATCH] Tweak print cancelling behaviour Fix movement on certain positions of the Z axis --- Marlin/AnycubicTFT.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/AnycubicTFT.cpp b/Marlin/AnycubicTFT.cpp index 67efe12..89a575b 100644 --- a/Marlin/AnycubicTFT.cpp +++ b/Marlin/AnycubicTFT.cpp @@ -465,17 +465,21 @@ void AnycubicTFTClass::StateHandler() #ifdef ANYCUBIC_TFT_DEBUG SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16"); #endif - if((current_position[Z_AXIS]>200)) { + if((current_position[Z_AXIS]>=200)) { enqueue_and_echo_commands_P(PSTR("G91")); enqueue_and_echo_commands_P(PSTR("G1 Z1 F240")); enqueue_and_echo_commands_P(PSTR("G90")); + } else if ((current_position[Z_AXIS]<200)) { + enqueue_and_echo_commands_P(PSTR("G91")); + enqueue_and_echo_commands_P(PSTR("G1 Z5 F240")); + enqueue_and_echo_commands_P(PSTR("G90")); } else if ((current_position[Z_AXIS]<190)) { enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z15 F240")); + enqueue_and_echo_commands_P(PSTR("G1 Z10 F240")); enqueue_and_echo_commands_P(PSTR("G90")); } else if ((current_position[Z_AXIS]<150)) { enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z50 F240")); + enqueue_and_echo_commands_P(PSTR("G1 Z35 F240")); enqueue_and_echo_commands_P(PSTR("G90")); } enqueue_and_echo_commands_P(PSTR("M84"));