Is there a way to reset a filament motion sensor after it triggers?

I’ve installed a BTT “smart” filament motion sensor using a Spider MCU. When it triggers, the printer pauses appropriately, but after I resume it, the query_filament_sensor command keeps returning “filament not detected,” and if there is a second event, the printer does not pause. Is there a way to reset the sensor? Is there anything I need to change in my configuration?
Thanks!

For anyone trying to troubleshoot a similar situation, what was happening is that my sensor was busted. Klipper would pause the print at the beginning of the print and I would resume it, but the status stayed “filament not detected” because the sensor was still busted. Klipper doesn’t trigger a second pause in this situation, which was what baffled me.

I am having a similar issue, did you solved it?

What had happened in my case is that the filament monitor was broken. I installed a new one and everything started working again. Are you sure yours is working?

yes, I have checked the output pins of the sensor, and you can see the pulses when the filament is running. I have also disassemble and assembled the whole sensor and there was nothing wrong

Can you describe what is happening? When does the filament trigger?

I have configured the sensor as per this page: Setup a BTT Smart Filament Sensor | Voron Documentation

The sensor worked two weeks ago when it was connected to the Raspberry Pi and I was using Marlin. Since I switched to Klipper for the first time in my life, I can not make it work properly.

every time the print starts, right after the purge line is done, the sensor triggers the runout gcode. so there you have the first issue!

Scond thing is, that after I put the printer to print again, the sensor will never trigger again, no matter how many times I enable and disable it. Actually, in mainsail, it is shown as “empty”.

I know for sure that the runout_gcode is working since I have triggered it by hand. The sensor itself works, as I have checked the signal pulses with an oscilloscope. and I have disassembled it completely, there was nothing wrong with it, and after I assembled it again, it has the same behavior.

I have an SKR 1.4 Turbo

I don’t know if it would make a difference, but I have mine connected to the MCU, not the Pi. Did you configure your raspberry as an MCU?

Yes, my sensor is connected to the SKR too! I was just explaining how it was working before I switched to Klipper.

To clarify, the sensor is connected to E0-DET on the mainboard SKR 1.4 Turbo

Try disabling the sensor at the beginning of your start code and then re-enabling it at the end and see if that makes it work. If that’s the case it could mean that the purge line is set to extrude more than what the extruder can push causing klipper to trigger the sensor. I have my filament sensor set to 20 mm and my purge line is long, rather than thick.

I have alredy tried that, actually at the begining I was enabling the sensor after layer 2, just to be safe, since first layer is slower than the rest of the print. and it was not working. I will give it a try again!

Nop, If I disable the sensor at the begining of the start_print macro, and enable it after that, it will never trigger, and it will be shown as “empty” on mainsail

Im running out of ideas. Try connecting it to a different pin in the SKR, just in case you have a bad pin on the board. If that doesn’t work I would blame the BTT after all. I made a filament sensor following this guide
https://youtu.be/v2mQ4X1J3cs
and I think it woks better than the BTT.

hahaha, me too, I was actually thinking the same, I will check if E1-DET will work, if not, I will give up :frowning: maybe will work after I switch to CAN Bus communication!

I am the most idiot of all the idiots! I was connecting the cable to the wrong header… two weeks with this issue, I was even looking at the python code of the sensor to see if I could find anything. Thank you very much by the way!

I’m glad you fixed it! Happy to help.

Short: Should removing filament cause dashboard displayed value to transition from detected to empty ?

Long:
Am intuitively expecting (assuming?) behavior of removing filament causing “empty” to be displayed for an active smart filament sensor.

Instead, am actually seeing “detected” continues to be displayed regardless of whether filament is subsequently removed/inserted. Enabling/Disabling the sensor makes no difference. Only restarting Klipper firmware causing sensor to show state at time of start up.

Same here.

On my Octopus v1.1, am seeing, for Diag 4, 5 or 6 that an enabled filament motion sensor will be display as “empty” (no filament detected). As expected.

Shoving filament in causes “detected” to be set and displayed. As expected.

“detected” continues to be displayed after removing filament. Unexpected.

image

Shared [filament_motion_sensor SFS_T0] section within my printer.cfg.

Klippy.log contains…

Filament Sensor SFS_T0: insert event detected, Time 5257.57

But no mention of subsequent removals and inserts.

From [filament_switch_sensor.py#L84(https://github.com/Klipper3d/klipper/blob/d32a83345518f4bb632bef9ca2de669b35f0e555/klippy/extras/filament_switch_sensor.py#L84) …

Um, runout event only fired if is_printing is true?

I’m not an expert, but I’ve been using a filament motion sensor for several months. It only triggers if the extruder is supposed to be moving at the same time. Obviously, when printing, but also at other times, such as when loading filament. I had to disable it in my loading macro because sometimes it would trigger if the gears did not catch the filament. It does not have a way of detecting whether the filament is moving in or out, so it cannot detect that the filament was removed.

Thank you for the helpful info @gabe.mi, please correct/confirm my new understanding…

The BTT Smart Motion Sensor can only detect motion, the sensor is not able to detect whether filament is present or not.

So, Klipper infers whether filament has run out when the extruder is pulling filament through, but no motion is detected by the sensor for some number of millimeters. This is why, when no active printing job is running (i.e no extruder movement), the dashboard can only detect motion has occurred since reboot, but has no idea if filament is present or not.

Started asking these questions because I’m trying to verify sensor is configured and behaving correctly before printing on my V1 Engineering MP3DP v4 build. Ironically, looks like I need to print something to verify the motion based runout sensor config/hardware is working :slight_smile:

Update: Did tear down, device can only detect filament motion, not presence, shame…

You are correct. These sensors have a wheel with openings in it that intermittently blocks the light to an optical sensor as the filament turns it. If the sensor receives no change in signal for a certain amount of time calculated by the speed of the extruder, it triggers.

1 Like