Browse Source

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.
D.R.racer 2 years ago
parent
commit
45a5e719a2
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Firmware/Filament_sensor.cpp

+ 3 - 2
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);