#Filament Sensor

37 messages · Page 1 of 1 (latest)

magic plinth
#

Looking for some tips to set this up as my current testing keeps failing..

I installed a simple 2 wire switch (NO) in my SB Toolhead, it's designed for 2 (Filematrix) but I wanted to start with one, just for a simple runout sensor...

I defined it like this in my printer.cfg:

[filament_switch_sensor Stealthburner_Filament]
pause_on_runout: True
runout_gcode:
PARK_MACRO
M117 Out of Filament
insert_gcode:
M117 Resuming
RESUME_MACRO
event_delay: 3.0
pause_delay: 0.5
switch_pin: EBBCan:gpio22

It's wired to GPIO22 and Ground (https://github.com/bigtreetech/EBB/blob/master/EBB SB2209 CAN (RP2040)/Hardware/EBB SB2209 CAN V1.0(RP2040)-Pin.png)

The switch does show up in Klipper, but no matter how I define it, inverted or not, it does always or never "detect filament" however it doesnt matter if there is filament loaded or not.

Mechanically the switch and steel ball works.

What else do I need possibly? Or is this wrong? Also wondering how to implement the pause features then..

GitHub

Contribute to bigtreetech/EBB development by creating an account on GitHub.

dapper berry
#

have you got a pullup ^ in front of the pin definition

#

this is usually required for a switch to function

magic plinth
#

I tried a few times with: ~!

#

and without

dapper berry
#

that's just inverting the logic

magic plinth
#

oh

#

so you mean like this?

switch_pin: ^EBBCan:gpio21

dapper berry
#

yes

magic plinth
#

hmm

#

If I define it like this:

switch_pin: ^EBBCan:gpio21

it still won't correctly detect..

#

trying it like this: switch_pin: ~!^EBBCan:gpio21 throws an error though

dapper berry
#

the most you would need would be ^! depending on how the switch is wired

dapper berry
magic plinth
#

hmm

#

no matter how I do it, it won't correctly show filament loaded..

switch_pin: ^!EBBCan:gpio21

switch_pin: ^EBBCan:gpio21

#

How can I fuck this up..?

#

I measured the switch wiring, it does switch..

dapper berry
#

is it definitely connected to gpio21

magic plinth
#

Yeah

dapper berry
#

and ground

magic plinth
#

on the probe connector - ground right next to it

#

if I test the connector on the toolhead pcb, the probe GPIO21 and GND I do get a signal through and it stops withouth filament in

#

but somehow Klipper doesnt recognize that correctly

dapper berry
#

show your current code

magic plinth
#
pause_on_runout: True
#runout_gcode:
#    PARK_MACRO
#    M117 Out of Filament
#insert_gcode:
#    M117 Resuming
#    RESUME_MACRO
#event_delay: 3.0
#pause_delay: 0.5
switch_pin: ^!EBBCan:gpio21
vital mauveBOT
#

When posting configs or logs, please surround with code fences (```) so that Discord formats them correctly. Example:
```ini
[mcu]
serial: /dev/serial/by-id/usb-klipper-12345-if00
```

[mcu]
serial: /dev/serial/by-id/usb-klipper-12345-if00
dapper berry
#

if you use triple backticks it makes it easier for us to read 🙂

#

i'm going AFK for a bit- if you need more help with this post a link to this thread in #klipper_kalico_discussion

magic plinth
#

Im still testing.. but it still doesn't work as intended..
It always shows detected, or empty - depending on invertion, but never is correct.

2 switches on "PROBE" prot here: https://github.com/bigtreetech/EBB/blob/master/EBB SB2209 CAN (RP2040)/Hardware/EBB SB2209 CAN V1.0(RP2040)-Pin.png

GPIO21 - GND - GPIO22 but I have only 21 active now as it keeps failing.

They do share the GND pin, could that be a problem..?
If I check with multimeter it does switch from always open to closed when triggered.

[filament_switch_sensor Stealthburner_Filament]
pause_on_runout: True
switch_pin: ^!EBBCan:gpio21

to begin all I want is run out to stop and not print thin air 😅

dapper berry
#

sharing ground is fine.

what is "keeps failing"

at the very least there should be a switch readout visible to you in the web interface

magic plinth
#

Yes I get this switch.

what fails is:

no matter if it is enabled, or disabled - if it's inverted or not, if its pulled up or not:
it does either always or never "detect filament" when I do:

QUERY_FILAMENT_SENSOR SENSOR=Stealthburner_Filament

there is no impact on the state if the switch is triggered or not.

#

hope that makes sense

dapper berry
#

hmm. i am stuck then. you're welcome to open a #request_help ticket to get more eyes on the subject