Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filament runout sensor not working #50

Closed
johncotten opened this issue Mar 12, 2024 · 15 comments
Closed

Filament runout sensor not working #50

johncotten opened this issue Mar 12, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@johncotten
Copy link

The filament runout sensor does not appear to be on PB14. I also found reference of a PE1 but that does not appear to be correct either.

Config in printer.base.cfg

[filament_switch_sensor runout_sensor]
pause_on_runout: False
switch_pin: !PB14
event_delay: 1.0

@KaruroChori
Copy link
Collaborator

KaruroChori commented Mar 12, 2024

There were two filament runout sensors reported in the very first alpha release, both of which disabled by default.
In theory, the one not used was later removed.

Could it be that different board revisions have one or the other connected?

@consp
Copy link
Collaborator

consp commented Mar 12, 2024

Tested, can confirm it does not work. (on both of the pins)

It's connected to PB14 on the AD5M non pro. If someone could check it on the pro that would be nice. The low/high signal reaches the pin so I guess it's a software issue. If the fillament led works the signal works.

Note: turn off power of course. The picture was made later.

pins

@consp
Copy link
Collaborator

consp commented Mar 12, 2024

Stock also seems to ignore the sensor. Does anyone know it actually works on stock?

@jtenniswood
Copy link

Yes it does work on stock, I have experienced the printer parking when the sensor was triggered.

@consp
Copy link
Collaborator

consp commented Mar 12, 2024

I guess there is some additional magic somewhere, diving into stock now to see what goes on. The firmwareExe log report it, so it definitly does something.

stock performs QUERY_FILAMENT_SENSOR SENSOR=e0_sensor to query the sensor. which is PB14, so it should work...

I'm getting the distinct impression klipper is not in on the sensor triggering somehow.

@xblax
Copy link
Owner

xblax commented Mar 12, 2024

I also recently noticed that the filament sensor stopped working for me, but I thought this is caused by a jam of my filament sensor, not a Klipper issue. Because it was working initially for me in Klipper. You can see it in the screenshot that I posted here:
g992/flashforge-ad5m-5mpro-research#6 (comment)

I'm not sure when it stopped working, because I didn't pay much attention to it. It's also possible something broke due to refactoring of the printer config; https://github.com/xblax/flashforge_adm5_klipper_mod/commits/master/printer_configs/printer.base.cfg

@KaruroChori KaruroChori added the bug Something isn't working label Mar 12, 2024
@consp
Copy link
Collaborator

consp commented Mar 12, 2024

Reloading the original cfg works, I can now detect it. It's definately a cfg issue.

The trick is adding the e1_sensor. Somehow I guess PE1 is doing something to make it work.

consp added a commit that referenced this issue Mar 12, 2024
…loaded before the PB14 one and must be present
@consp
Copy link
Collaborator

consp commented Mar 12, 2024

The fix is pushed to master, strange but true. I guess it's a configuration thing as the PE1 pin is not exposed on the 48 or 64 pin package.

The manual fix is to edit printer.base.cfg and add the following before runout_sensor:

# Filament runout e1 sensor must be loaded before runout sensor for it to work
[filament_switch_sensor _e1_sensor]
pause_on_runout: False
switch_pin: !PE1
event_delay: 1.0

For reference:
image

@consp consp closed this as completed Mar 12, 2024
@xblax
Copy link
Owner

xblax commented Mar 12, 2024

@consp Can you rename it to "_e1_sensor"? Then it should not show up in the Gui and confuse everyone.

@consp
Copy link
Collaborator

consp commented Mar 12, 2024

@consp Can you rename it to "_e1_sensor"? Then it should not show up in the Gui and confuse everyone.

sure, I'll amend it and force push for niceness

consp added a commit that referenced this issue Mar 12, 2024
…loaded before the PB14 one and must be present
@johncotten
Copy link
Author

johncotten commented Mar 13, 2024

Thank you @consp and to all that fixed this so quickly! Confirmation the e1 sensor resolved it for me. I wanted to test a few prints, and I think these are the correct settings now if anyone updates to the BTT SFS V2.0 smart filament runout sensor with motion detection. I was getting a few false positive runouts, but changing to 5mm seems to resolve the issue. Here is the update lines needed in printer.base.cfg if anyone goes with this mod:

# Filament runout e1 sensor must be loaded before runout sensor for it to work
[filament_switch_sensor _e1_sensor]
pause_on_runout: False
switch_pin: !PE1
event_delay: 1.0

# Filament runout sensor
[filament_motion_sensor runout_sensor]
switch_pin:^PB14
detection_length: 5
extruder: extruder
pause_on_runout:False
runout_gcode:
    PAUSE # [pause_resume] is required in printer.cfg
    M117 Filament runout

@consp added code markdown for clarity

@DougJoseph
Copy link

Thank you all for catching and fixing this! I just have one question. Where it says “pause at runout” is set to false, I would think that you would want it to pause at runout. Am I misunderstanding how that code is intended to function?

@xblax
Copy link
Owner

xblax commented Mar 24, 2024

Thank you all for catching and fixing this! I just have one question. Where it says “pause at runout” is set to false, I would think that you would want it to pause at runout. Am I misunderstanding how that code is intended to function?

Yes, good point. I will try to test it.

@xblax
Copy link
Owner

xblax commented Mar 24, 2024

@DougJoseph
I did now properly integrate the runout sensor with some macros:

image

This will be in the next release.

@DougJoseph
Copy link

Wow you are amazing!! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants