What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

BTT Smart Filament sensor

VoronAT

Member
Printer Model
Voron 2.4
Extruder Type
Galileo
Cooling Type
AB-BN
I'm installing a Smart Filament sensor with a BTT Octopus. Is there a good source of information regarding configuring Klipper and wiring?
 

Rysatko

New member
I used wiring harness that comes with the sensor to connect it to BTT Octopus using pin PG12. Here is my config:

Code:
[filament_motion_sensor filament]
detection_length: 25.0         #The minimum length of filament pulled through the sensor to trigger a state change on the switch_pin.
extruder: extruder             #The name of the extruder section this sensor is associated with.
switch_pin: ^PG12              #The pin on which the switch is connected.
pause_on_runout: True
runout_gcode:
    M117 Filament out
    _RUNOUT_INFO

[gcode_macro _RUNOUT_INFO]
gcode:
  {% if 'filament_motion_sensor filament' in printer.configfile.settings %}
    {% set enable = printer['filament_motion_sensor filament'].enabled %}
    {% set detect = printer['filament_motion_sensor filament'].filament_detected %}
    {action_respond_info("RUNOUT Motion Sensor:
                          Enabled: %s
                          Detect Filament: %s" % (enable|lower,detect|lower))}
  {% endif %}
 

VoronAT

Member
I used wiring harness that comes with the sensor to connect it to BTT Octopus using pin PG12. Here is my config:

Code:
[filament_motion_sensor filament]
detection_length: 25.0         #The minimum length of filament pulled through the sensor to trigger a state change on the switch_pin.
extruder: extruder             #The name of the extruder section this sensor is associated with.
switch_pin: ^PG12              #The pin on which the switch is connected.
pause_on_runout: True
runout_gcode:
    M117 Filament out
    _RUNOUT_INFO

[gcode_macro _RUNOUT_INFO]
gcode:
  {% if 'filament_motion_sensor filament' in printer.configfile.settings %}
    {% set enable = printer['filament_motion_sensor filament'].enabled %}
    {% set detect = printer['filament_motion_sensor filament'].filament_detected %}
    {action_respond_info("RUNOUT Motion Sensor:
                          Enabled: %s
                          Detect Filament: %s" % (enable|lower,detect|lower))}
  {% endif %}
Cool. Thanks.
 

LoadMaster7

Well-known member
I used wiring harness that comes with the sensor to connect it to BTT Octopus using pin PG12. Here is my config:

Code:
[filament_motion_sensor filament]
detection_length: 25.0         #The minimum length of filament pulled through the sensor to trigger a state change on the switch_pin.
extruder: extruder             #The name of the extruder section this sensor is associated with.
switch_pin: ^PG12              #The pin on which the switch is connected.
pause_on_runout: True
runout_gcode:
    M117 Filament out
    _RUNOUT_INFO

[gcode_macro _RUNOUT_INFO]
gcode:
  {% if 'filament_motion_sensor filament' in printer.configfile.settings %}
    {% set enable = printer['filament_motion_sensor filament'].enabled %}
    {% set detect = printer['filament_motion_sensor filament'].filament_detected %}
    {action_respond_info("RUNOUT Motion Sensor:
                          Enabled: %s
                          Detect Filament: %s" % (enable|lower,detect|lower))}
  {% endif %}
Is your 25.0 detection length a number from experience with the sensor? The reason for asking, if I am not mistaken, BTT suggest 7mm. I normally end up at about 10mm to avoid error triggers.
 

ZoZo

Member
I ended up using 15 mm for my printer after discovering that lower values caused false triggers...

Seems like it is something that one has to tune for one's own printer.
 
I've been looking at the Klipper code for the motion sensor and it seems that the way it works is:
  1. The filament sensor toggle the switch_pin every so often. I don't know how often that is since I am not sure that BTT document it. On every toggle, Klipper updates the filament trigger point to be the current extruder position + the detection distance. Extruder position seems to mean "the amount of filament (in mm) that the extruder has pushed so far".
  2. Every 0.25 seconds, Klipper checks the current extruder position and if it's less than the trigger point, it consider is a "filament present". Otherwise, it triggers "filament runout" event.
So, it seems that the detection length tuning will be a function of the extrusion rate of the printer. If the printer can print more than the detection length in a quarter of a second, the sensor will cause a false negative. 25mm detection length is 100mm/s. That seems pretty high but may be I still not fully understanding how the filament sensor code wors.
 
Top