From 45a5e719a25fc9274bb60e480dd9e0e9e64e45a2 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Thu, 16 Jun 2022 08:33:12 +0200 Subject: [PATCH] Disable filRunout when MMU.Enabled() It turned out the runout is caused by the ramming sequence in the G-code, which is interpreted before the actual MMU command gets into processing. The frequency of these errors/runouts differed one machine from another and was really hard to track down. Therefore - once the MMU is enabled (active and running) we'll disable filament runout handling caused by the printer's filament sensor. --- Firmware/Filament_sensor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Firmware/Filament_sensor.cpp b/Firmware/Filament_sensor.cpp index 2c1fd3de4..8d383b1a5 100644 --- a/Firmware/Filament_sensor.cpp +++ b/Firmware/Filament_sensor.cpp @@ -117,6 +117,7 @@ void Filament_sensor::triggerFilamentInserted() { void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled + && (! MMU2::mmu2.Enabled() ) // quick and dirty hack to prevent spurious runouts just before the toolchange && (eFilamentAction == FilamentAction::None) && !saved_printing && ( @@ -130,7 +131,7 @@ void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOPGM("runoutEnabled="); SERIAL_ECHOLN((int)runoutEnabled); // SERIAL_ECHOPGM("eFilamentAction="); SERIAL_ECHOLN((int)eFilamentAction); // SERIAL_ECHOPGM("saved_printing="); SERIAL_ECHOLN((int)saved_printing); -// filRunout(); + filRunout(); } } @@ -146,7 +147,7 @@ void Filament_sensor::filAutoLoad() { } void Filament_sensor::filRunout() { - SERIAL_ECHOLNPGM("filRunout"); +// SERIAL_ECHOLNPGM("filRunout"); runoutEnabled = false; autoLoadEnabled = false; stop_and_save_print_to_ram(0, 0);