Marlin: [BUG] SKR 1.4 Filament Runout Sensor on Pins 1.26 & 1.25 don't work when printing. M600 is not executed.

Created on 20 Sep 2020  ·  109Comments  ·  Source: MarlinFirmware/Marlin

Bug Description

Both runout sensors are configured to pins 1.26 and 1.25 M119 shows correct working behavoir when Filament is in or out status changes between open and triggered correctly. M600 isn't executed.

My Configurations

Config.zip

Steps to Reproduce

  1. try sensors with M119 when filament is in and out
  2. start a print
  3. simulate an empty filament spool

Expected behavior: I would expect running of M600 which is configured

Actual behavior: No reaction on missing filament M412 is activated

Additional Information

There is no sensorless homing and no diag pins

  • Provide pictures or links to videos that clearly demonstrate the issue.
  • See How Can I Contribute for additional guidelines.
Bug? False Alarm Filament Sensor

Most helpful comment

okay, just compiling again

There's no need to comment each step. Just comment after you've run the commands to keep down notifications/this thread length 🙂

All 109 comments

Switched to a SKR 1.3 with same firmware and same issue.

I have the same issue on skr1.4.
M412 is activated, M119 shows correct working; M600 not activated, just keeps printing

I just tested a couple SKR 1.4 builds running bugfix-2.0.x (225487f9db7d1a7aaf6886a283c7758a9ae2181e) with a filament runout sensor connected to FIL_RUNOUT_PIN/P1_26 and filament runout detection works as expected in both cases:

  • Begin print
  • Cut filament
  • Runout is triggered & M600 is kicked off
  • Filament automatically unloads
  • Prompted to load filament/press encoder to continue
  • Filament is loaded
  • Print continues after clicking Continue on the Purge More screen

M119 output with filament present: filament: TRIGGERED
M119 output with filament removed: filament: open

Have your filament runout sensors worked before? Can both of you test the latest bugfix-2.0.x to see if this is still an issue?

Thanks for your reply. My sensors worked before. M119 works well and also when printing M119 status is correct but M600 isn't triggered. M600 is activated. I'll try the bugfix later today.
Thank you again.

I tried it and M600 isn't triggered. Used the latest bugfix from today. I use these switches, they show right status with M119 even when printing and cutting filament.
Runoutsensor

I just tested a couple SKR 1.4 builds running bugfix-2.0.x (225487f) with a filament runout sensor connected to FIL_RUNOUT_PIN/P1_26 and filament runout detection works as expected in both cases:

* Begin print

* Cut filament

* Runout is triggered & `M600` is kicked off

* Filament automatically unloads

* Prompted to load filament/press encoder to continue

* Filament is loaded

* Print continues after clicking Continue on the Purge More screen

M119 output with filament present: filament: TRIGGERED
M119 output with filament removed: filament: open

Have your filament runout sensors worked before? Can both of you test the latest bugfix-2.0.x to see if this is still an issue?

Which kind of switches do you use Keith?

Which kind of switches do you use Keith?

A couple of Prusa's latest IR filament sensors and a basic 3 pin/switch style.

I tried a 3 pin switch without pcb and also not working. But all switches shop right M119 values. In the moment I've no idea what is causing the problem. A smart sensor is ordered to see how it works or not. Maybe the other guys who have same problem try out additional things. But first thank you for your help.

Running the latest bugfix from this morning didn't help me neither; problem remains.

The only difference I see is: M119 output with filament present: filament: OPEN
(I have a 'FIL_RUNOUT_STATE HIGH' switch

The only difference I see is: M119 output with filament present: filament: OPEN

Try inverting FIL_RUNOUT_STATE

Changed FIL_RUNOUT_STATE to LOW; M119 output with filament present: filament: TRIGGERED
But M600 is still not triggered in any way

Do you get any output over serial? Also, please zip up and attach your configs for review.

No, no output over serial
config.zip

I already did tests with LOW or HIGH before writing the issue. Also not triggering M600. It shouldn't matter if it's configured LOW or High, it should trigger if status of switch changes. Keith please provide your config to find any other settings which could influence. I would like to try your version to see if it'll run on my board. My switches should work, because they are standart in other printers too. Thank you

PS what do you mean with output over serial? Or is a TFT meant.

Bonjour, même soucis avec SKR 1.4 Turbo et capteur optique !... IMPOSSIBLE de lancer une impression : il me dit toujours qu'il n'y a plus de filament !

  • AVEC le filament :
    M109donne : TRIGGERED
    M412donne : Filament runout ON

  • SANS le filament :
    M109donne : OPEN
    M412donne : Filament runout ON également

Mes paramètres (Configuration.h) :

#define FILAMENT_RUNOUT_SENSOR
  #define FIL_RUNOUT_ENABLED_DEFAULT true
  #define NUM_RUNOUT_SENSORS   1
  #define FIL_RUNOUT_STATE     LOW
  #define FIL_RUNOUT_PULLUP
  #define FILAMENT_RUNOUT_SCRIPT "M600"

dans pins_BTT_SKR_V14.4.h :

#define FIL_RUNOUT_PIN                     P1_26  // E0DET    => J'ai bien connecté le S du capteur sur cette pin
#define FIL_RUNOUT2_PIN                    P1_25  // E1DET

J'utilise Marlin 2.0.6.1...

skr1.4Turbo.zip

Here's an example config that uses a simple switch: SKR14-example.zip

PS what do you mean with output over serial? Or is a TFT meant.

I mean like terminal output over USB/in your host software like Pronterface/OctoPrint/etc.

@medline2c Please don't paste your config since translating your comments will be more difficult. Just zip them up and attach.

@ medline2c Veuillez ne pas coller votre configuration car la traduction de vos commentaires sera plus difficile. Fermez-les simplement et attachez-les.

Désolé, je suis nouveau ici, j'ai supprimé les commentaires pour laisser l'essentiel : je dois tout supprimer ou je laisse ainsi ?
J'ai regardé l'exemple SKR14-example.zip, je ne vois rien de différent de ma configuration si ce n'est HIGH au lieu de LOW pour FIL_RUNOUT_STATE. J'ai essayé HIGH et ça donne le même résultat..

@ medline2c Veuillez ne pas coller votre configuration car la traduction de vos commentaires sera plus difficile. Fermez-les simplement et attachez-les.

J'ai testé tes fichiers avec MOTHERBOARD BOARD_BTT_SKR_V1_4_TURBO

Aucun changement, mêmes symptômes que décrit précédemment ...

I tried Keith's config with todays bugfix and it also doesn't work on my SKR 1.4 . I tried several switches and had no luck.

Check your wiring as well?

Wiring is okay, V G S are right, also when using a 2 wire switch. Otherwise there could be a short. M119 shows right status.

Same here; Everything looks and registers ok but marlin doesn't seem to notice the pin change.

Success! Changing #define FILAMENT_RUNOUT_SCRIPT "M600" to "M600 T0" did the trick for me.
(got it from issue #18341)

Shouldn't this be documented somewhere within Marlin?

Success! Changing #define FILAMENT_RUNOUT_SCRIPT "M600" to "M600 T0" did the trick for me.
(got it from issue #18341)

M600 should work with the active extruder.

@martinziener: you shouldn't have had to specify the extruder since since your config is for a single extruder/hotend. M600 works without T0 on my single nozzle/single extruder builds, so it's odd that it doesn't work the same for yours.

In the case of @kkberg's config with dual extruders, specifying M600 T0 may have an undesired effect of performing the filament swap on the incorrect extruder.

It works with T0, tried again without T0 but no success.

Just for good measure, are you Initializing EEPROM after each flash? You can do it through the LCD or by sending M502 followed by M500.

:-) yes

Tried M600 T0 but still same problem. I now try it out with defining only on sensor. I think it's definitly a Marlin error. I found the M600 T0 some days ago and it didn't work with the vanilla version.

No succesess, tried with both switch versions. I now go down to one extruder and try out if it depends on extruder count.

still not working ... @martinziener would you please send me your config and commit version you use? Thank you

config.zip
It's the bugfix version from this morning, I don't know where I can find the exact commit version
Be ware... it's configured for corexy

thank you, I'll make the needed changes for my printer. I also use that version.

Je ne peux tester cette solution car ma version ne me permets pas de démarrer l'impression : il me dit toujours qu'il n'y a pas de filament... dois-je ouvrir un autre post pour ce soucis ou est-ce en lien ?

@medline2c; I don't think these problems are related

Didn't work with one extruder too. Don't know if it makes sence to go on with sensors. Printing is possible without sensors. I think if it works on several boards and on my board not it could be hardware but I'm not convinced. May be I give Klipper a try or Smoothieware.

Just got a smart runout sensor and it also doesn't work on the 1.4 . Game over ... with BTT

Which drivers are you using? Are they using any Diag pin?, in that case it wouldn't work

My drivers are TMC2130 but don't have the diag pin soldered, I don't use sensorless homing. That was the first thing I did and took the pins off.

You could try the P0_10 probe pin, at least that one doesn't have hardware pullups
(I use that pin for my inductive z-probe)

I'll give it a try, I have BL-Touch on Z-min. Thank you

Hello Guys,

"First: Sorry for my bad English. I'm from Germany and had a little help from a translator."

I have this problem too. I use a SKR 1.4 Turbo with TMC2208 a Bigtreetech 2 in 1 Out hotend and 2 runout sensors on a TFT 35 V3.0. (Marlin V2.0.6.1)

Both runout sensors are connected to pin 1.25 and 1.26.

At pin 1.26 a signal bridge is connected to the TFT 35 to trigger the runout sensor in touchscreen mode. (If you don't do this, the sensor only works in touchscreenmode and not in marlin mode of the display but that's not important here)

As I said, Runout Sensor 1 of pin 1.26 on the board is additionally connected to the TFT 35 (Only Ground & Signal).

If I now print with the TFT 35 in touchscreen mode the Runout Sensor 1 works (it is bridged to the display). If I now print in Marlin mode for Filament Mixing then BOTH runout sensors do NOT work!

With Pronterface I can trigger both runout sensors easily and they work.

I also think it is a Marlin problem because the sensor works on the TFT35 display and this has his own firmware.

Today after work I will try the current bugfix version. Maybe the problem is solved.

Please attach your configs. Also: Have these sensors worked in a prior version of Marlin?

It's odd that there's now a run of people having issues all of sudden, especially since I can't reproduce them on my boards.

yes, everything worked in V2.0.6.0

I noticed it when I changed to the Bigtreetech 2in 1out a few days ago. There I updated to V2.0.6.1.

after the rebuild i only set the Mixing in the configuration files.

The sensors are also only gimmicks. It also works without. But as it is, if it is there it should work.

I attach my Config V2.0.6.2 with Mixing and also my old Config V2.0.6.0 WITHOUT Mixing.

With V2.0.6.1 there was also the problem that my Z-axis went in the wrong direction (I have CoreXY) and so I had to change the direction of rotation.

Yesterday I played a little bit with VSCode and I hope that no strange things are activated in the current configuration. I tried to solve the problem with #define FILAMENT_RUNOUT_SCRIPT "M600" to "M600 T0". But I didn't flash it to the printer because there were a lot of yellow warning messages when compiling.

I am still at work and can only show the configuration that is stored on the NAS. So if you look at my configuration V2.0.6.1 please ignore everything that is unnecessary and has nothing to do with runout sensors.
Config v2.0.6.1 Mixing E.zip
Config V2.0.6.0 Without Mixing.zip

@Trenchi Please try with the latest bugfix-2.0.x to see if your runout sensors work.

I pinged @rhapsodyv since there were some possible PRs of his that may have affected this board and he's received similar reports from users with Chitu boards (STM32F103RE).

This _could be_ a deeper Marlin issue, but he's looking into it.

Just tried P0.10 and also correct values with M119 but not triggering M600. @Trenchi I'm from Germany too :)

I pinged @rhapsodyv since there were some possible PRs of his that may have affected this board and he's received similar reports from users with Chitu boards (STM32F103RE).

This _could be_ a deeper Marlin issue, but he's looking into it.
@thisiskeithb That sounds promissing and hopefully he will find it. I already prepared a lot of boards with Marlin and I had always luck :). Thank you Keith for your help

@kkberg

Did the printer pause or it keep working?

Did you try changing FILAMENT_RUNOUT_SCRIPT to M125 or M25 to test?

I'm trying to isolate the problem.

@rhapsodyv print keeps printing without any pause. I didn't try M125 or M25 because I didn't know that it's possible to use any other gcode. I'll try it soon. Thank you very much for your fast answer.

@rhapsodyv tried M125 instead of M600 but also same behavior. I mad a little video but only have to hands to manage :).
https://youtu.be/bRG2cztqjiA

@kkberg do you have two sensor? Both aren't working?

@kkberg do you have two sensor? Both aren't working?
@rhapsodyv
Yes, but now I test with only one sensor to make it easier.

Lets do a test. In the file Marlin/src/feature/runout.h line 44, uncomment it:

//#define FILAMENT_RUNOUT_SENSOR_DEBUG

Run a test and past here the serial output.

Lets do a test. In the file Marlin/src/feature/runout.h line 44, uncomment it:

//#define FILAMENT_RUNOUT_SENSOR_DEBUG

Run a test and past here the serial output.

I'm just compiling

@kkberg Hab ich mir schon fast gedacht, frag mich nicht warum :-)

i found something out.

if #define MIXING_EXTRUDER is enabled then the runout sensors do not work.

if I disabled #define MIXING_EXTRUDER then the sensors work again.

should it be that way?

I tried several times, but no output when sensor ist triggered. Seems that runout.h is not touched. M119 shows right status!

@kkberg Hab ich mir schon fast gedacht, frag mich nicht warum :-)

i found something out.

if #define MIXING_EXTRUDER is enabled then the runout sensors do not work.

if I disabled #define MIXING_EXTRUDER then the sensors work again.

should it be that way?
@Trenchi
Bist Du eventuell in unserer FB-Gruppe https://www.facebook.com/groups/364846444121852/requests/?hoist_pending_member_ids_suggested_order=100003731024132&notif_id=1600955952536028&notif_t=group_r2j für SKR Boards

@kkberg Nee leider nicht, ich bin nicht so aktiv bei Facebook....ich hab meinen Account seit 5 Jahren nicht mehr geupdatet ^^

@kkberg Nee leider nicht, ich bin nicht so aktiv bei Facebook....ich hab meinen Account seit 5 Jahren nicht mehr geupdatet ^^

@Trenchi hätte ja sein können.

I tried several times, but no output when sensor ist triggered. Seems that runout.h is not touched. M119 shows right status!

Last test: can you disable multiple sensors and multiple extruders? Doing a test with only one?

Just working on it ....

No change, no output on host.

No change, no output on host.

:-(

try putting this in your config file:

#define FILAMENT_RUNOUT_THRESHOLD 1

or even:

#define FILAMENT_RUNOUT_THRESHOLD 0

Still no change, no host output but M119 is showing correct status. Used both versions for threshold.

If you manually send M600, does a filament change occur?

If you manually send M600, does a filament change occur?

Yes it did, I tried it already

Did you try sending or putting M412 S1 in your gcode file?

What is the output of only M412 ?

Did you try sending or putting M412 S1 in your gcode file?

Yes and I have a special gcode file for test print where I put it in. Also M412 is permantly enabled by #define FIL_RUNOUT_ENABLED_DEFAULT true

What is the output of only M412 ?

it says that runout ist switched on

Did you cut the right diag pin? :-p hahahah I'm running out of ideas

Did you cut the right diag pin? :-p hahahah I'm running out of ideas

yes, there are no diag pins in my TMC2130. But why shows M119 the right status?

  • [x] no diag pin conflit
  • [x] enabled
  • [x] M119 working
  • [x] threshold test
  • [x] M600 works when called manually

What more can we try?

Maybe try M43 W P126 I and M43 W P125 I, to check if it change state accordingly ...

It shows:
m43

What do I have to change in config that M43 works? I'm just confused.

What do I have to change in config that M43 works? I'm just confused.

Enable PINS_DEBUGGING and run M43 W P126 I & M43 W P125 I again.

okay, just compiling again

There's no need to comment each step. Just comment after you've run the commands to keep down notifications/this thread length 🙂

image

Now you need to test the sensor, and check the output to see if behave accordingly

Not able to print because controller hangs after starting print file

M43 W is not intended to use while printing. You call it, and test the sensor, to check if the output react for changes in the sensor.

okay, misunderstood. I tested it and send my screenshot and after that you wrote that I should test.
Debug shows that the pin is triggered but no action is taken. Switches work, but Marlin does not trigger M600.

image

So, it reacts? All time? You put filament in and out, and every time it generates an output accordingly?

So, it reacts? All time? You put filament in and out, and every time it generates an output accordingly?

Yes it does.
image

you can see the different valus with M43 only too.
image

image

@kkberg can you test this pre build firmware?

firmware.bin.zip

@kkberg can you test this pre build firmware?

firmware.bin.zip

I will do but not before monday, sorry for that. Thank you very much for your help. Have a nice weekend.

I was able to test this morning and it still doesn't work.

Any ideas or progress on the issue? :) Only want to know if someone is still working on it.

firmware.bin.zip

One more test... I need that you start a print with this firmware, and open the serial to check the messages... and test the sensor... it will output a lot of data.

Thank you for the test version. I flashed it, but no success. I did several times trigger the sensor and also checke with M119. M119 showed right status. I include a part of the out.
Runouttest.txt

Well.. now we have a hot clue... that log says you don't have an active printing!!

TFilamentMonitor::run(): e: 1, !filament_ran_out: 1, printingIsActive: 0, did_pause_print: 0

I was printing active a gcode file which wouzld take round about 5h. :)

Are printing using onboard SD or TFT?

Print over usb

Print over usb

more details please. Octo print?

What gcode are you using to print? can you share it?

And if you can, do one more test enabling print counter:

#define PRINTCOUNTER

Using Simplify3D for printing. Printing over SD from LCD it shows print:1 and directly performing an filament change. Triggering a filament runout manully with the sensor nothing happens. new report included. where you can see that printing over usb doesn't have print status, only from SD.
Runouttest.txt

This is the gcode I use, but temp I set from LCD.
drawer2-update.gcode.txt

Well.... I think we found the problem..

Marlin have an internal flag that indicate if a printing is active. That flag is set in the following conditions:

  • start a print from SD
  • start a print from LCD
  • when PRINTJOB_TIMER_AUTOSTART is enabled and the gcode have one of the following commands: M104/M109/M190
  • when PRINTCOUNTER is enable and marlin receive M75

You aren't doing anything of those options, so, for Malin, you didn't start a print...

It's very uncommon to not use M109. I think you should use it in our gcode and do another test.

Okay, I'll try it again. Thank you.

Changed gcode to M109 as it should be done usually, but M600 isn't performed!!!
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0
LESEN: TFilamentMonitor::run(): e: 0, !filament_ran_out: 1, printingIsActive: 1, did_pause_print: 0

e: 0, means the runout is disabled

okay, but it is swiched on with M412 S1

; horizontalSizeCompensation,0

G90
M82
M412 S1
;PetG ozeanblau Spectrum 0.40mm
M106 S0; Luefter aus falls an
;G28

Okay, you are right :). After the first filament change the sensor was switched off and I manually sent M412 S1 again and then I triggert a filament runout and I did what it should. I'm very sorry if I was the problem and making such a lot of work!

Thank you very much again

Just a second please

Okay, the runout thing is solved, but that the status of M412 is changed after performing the M600 is still there.
Don't know if I have to open next issue or if it's wanted that the status of M412 is changed when having done the filament change. In the first image you see what apears when have to go on with printing. At first I have to confirm runout sensor and when I push the button M412 S0 happens, after that I have to confirm print again. That should be changed I think.
IMG_3876
IMG_3877

Now all is solved and both sensors are working. Logic off sensor I had to change and pullups had to be commented, because pullup on both sensors. After that logic shows triggered when filament is in and open when out. This works perfectly for me. Thank you for all the help from the team.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manianac picture manianac  ·  4Comments

Kaibob2 picture Kaibob2  ·  4Comments

Bobsta6 picture Bobsta6  ·  3Comments

ceturan picture ceturan  ·  4Comments

spanner888 picture spanner888  ·  4Comments