Tweak print cancelling behaviour

Fix movement on certain positions of the Z axis
This commit is contained in:
David Ramiro 2019-01-24 16:50:34 +01:00
parent ad683fdedc
commit b3af9708e9
No known key found for this signature in database
GPG Key ID: 5B042737EBEEB736
1 changed files with 7 additions and 3 deletions

View File

@ -465,17 +465,21 @@ void AnycubicTFTClass::StateHandler()
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16"); SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16");
#endif #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("G91"));
enqueue_and_echo_commands_P(PSTR("G1 Z1 F240")); enqueue_and_echo_commands_P(PSTR("G1 Z1 F240"));
enqueue_and_echo_commands_P(PSTR("G90")); 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)) { } else if ((current_position[Z_AXIS]<190)) {
enqueue_and_echo_commands_P(PSTR("G91")); 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")); enqueue_and_echo_commands_P(PSTR("G90"));
} else if ((current_position[Z_AXIS]<150)) { } else if ((current_position[Z_AXIS]<150)) {
enqueue_and_echo_commands_P(PSTR("G91")); 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("G90"));
} }
enqueue_and_echo_commands_P(PSTR("M84")); enqueue_and_echo_commands_P(PSTR("M84"));