[filament_motion_sensor] Further clarity thanks

I have a BTT smart filament sensor and was wondering if someone could enlighten me further in regards to how klipper handles the triggers.

I know the default is 7mm but I was wondering how does this work?

  1. Is it 7mm block triggers? So after 7mm of extruded filament with a no filament detected it triggers a no filament, then 7mm of filament triggers a detect filament trigger?
  2. Is it a rolling 7mm block? So as soon as the filament stops/breaks it takes 7mm of filament extruded to trigger? Or does klipper just check every 7mm extruded to see if a no/yes filament trigger?

Is there somewhere with a greater explanation thanks?

The encoder wheel in this sensor has a resolution that equals around 7mm length of filament. This means, for every 7mm of filament that passes the sensor, the sensor will send an impulse.
This also means that movements below this threshold cannot be detect.

The logic behind this sensor checks if the extrude movements should have had a length of 7mm AND if the sensor has send an impulse.
If 7mm should have passed the sensor but no impulse has been generated the logic assumes that something is wrong.

1 Like

I believe that the sensor output changes polarity about every 5mm so they recommend a configuration to fail after 7mm. In practice I find that 10mm gives good reliability with no false failures and I turn it off at startup then turn it on at the end of my PRINT_START processing. In the case of an MMU I turn it off when switching filaments as well.