From 51f1aa14a5540f64620b65d742f1d9ba92cb0930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 11 Mar 2023 15:48:25 +0000 Subject: [PATCH] PFW-1504 Update last position as quickly as possible 0.1mm extrusion may happen while updating the LCD No change in memory --- Firmware/mmu2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index e6c17c48a..d3474993e 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -246,8 +246,8 @@ bool MMU2::VerifyFilamentEnteredPTFE() { const float delta_mm = MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - logic.ExtraLoadDistance(); const float length_step_mm = 2 * (delta_mm) / (LCD_WIDTH + 1); - // reset current position to whatever the planner thinks it is float last_position = planner_get_machine_position_E_mm(); + MoveE(delta_mm, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); MoveE(-delta_mm, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); @@ -258,10 +258,10 @@ bool MMU2::VerifyFilamentEnteredPTFE() { fsensorState |= fsensorStateLCD; // No need to do the above comparison twice, just bitwise OR if ((fabs(planner_get_machine_position_E_mm() - last_position)) > length_step_mm) { + last_position = planner_get_machine_position_E_mm(); // Reset if (fsensor_pixel > 19) fsensor_pixel = 19; TryLoadUnloadProgressbar(fsensor_pixel++, 3, fsensorStateLCD); fsensorStateLCD = 0; // Clear temporary bit - last_position = planner_get_machine_position_E_mm(); // Reset } safe_delay_keep_alive(0); }