# Filament Motion Sensor Malfunction with Multiple Extruder Configuration

**URL:** <https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730>\
**Category:** General Discussion\
**Created:** [September 1, 2025, 5:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730 "2025-09-01T17:40:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rozarh](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@rozarh](https://klipper.discourse.group/u/rozarh)\
**Post date:** [September 1, 2025, 5:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/1 "2025-09-01T17:40:27Z")

</div>

### Basic Information:

Printer Model: TT1SM (DIY) [TT-1S Mod - reprapy.pl](https://reprapy.pl/viewtopic.php?t=9879)  
 MCU / Printerboard: BTT Manta M8P  
 Host / SBC: CM4  
 klippy.log

[klippy.log](https://klipper.discourse.group/uploads/short-url/6VfIp98WJbF7yssYkx7o6mUjg6I.log) (111.9 KB)

…

# Bug Report: Filament Motion Sensor Malfunction with Multiple Extruder Configuration

## System Configuration

- **Firmware** : Klipper
- **Hardware** : BTT Smart Filament Sensor Module v1.0 (SFSM)
- **Setup** : 4 extruders configuration
  - 1 main extruder `[extruder]` (with motor `[extruder_stepper e0]`, heater, etc.)
  - 3 auxiliary extruders configured as `[extruder_stepper ex]` (where x = 1-3)
  - Each auxiliary extruder has mechanical filament sensors (on/off)
  - Bowden tubes from 3 auxiliary extruders merge in a special connector, then pass through SFSM, then connect to main extruder at printhead

## Problem Description

### Expected Behavior

The filament motion sensor should accurately detect filament presence and movement based on actual filament state in the sensor.

### Actual Behavior

After Klipper restart:

- Three mechanical sensors show correct states (empty/detected based on filament presence)
- Motion sensor (SFSM) shows “empty” regardless of actual filament presence

When executing tool change commands (T0, T1, or T2):

- SFSM sensor state changes to “detected” and remains in this state until Klipper restart
- State remains “detected” regardless of:
  - Whether extruders are actually working
  - Whether filament is present in the sensor or not

### Configuration Details

**Filament Motion Sensor Configuration:**

```yaml
[filament_motion_sensor main_sensor]
detection_length: 7.0
extruder: extruder
switch_pin: PF5
event_delay: 3
pause_delay: 2
pause_on_runout: True

```

**Tool Change Macro Example (T0):**

```yaml
[gcode_macro T0]
gcode:
  SET_STEPPER_ENABLE STEPPER="extruder_stepper e1" ENABLE=1
  SYNC_EXTRUDER_MOTION EXTRUDER=e1 MOTION_QUEUE=extruder
  SYNC_EXTRUDER_MOTION EXTRUDER=e2 MOTION_QUEUE=
  SET_STEPPER_ENABLE STEPPER="extruder_stepper e2" ENABLE=0
  SYNC_EXTRUDER_MOTION EXTRUDER=e3 MOTION_QUEUE=
  SET_STEPPER_ENABLE STEPPER="extruder_stepper e3" ENABLE=0
  SET_GCODE_VARIABLE MACRO=_CURRENT_TOOL VARIABLE=tool VALUE='"e1"'

```

## Troubleshooting Performed

When changing sensor type from `filament_motion_sensor` to `filament_switch_sensor`, the sensor works correctly - showing cyclical detected/empty state changes when manually moving filament inside the sensor. This confirms the hardware is functioning properly.

## Suspected Root Cause

The issue appears to be related to `MOTION_QUEUE` operations. Adding or removing steppers from the motion queue seems to cause a software malfunction in the motion sensor. This is particularly puzzling because:

- The sensor is configured based on `[extruder]` movements
- The main extruder motor state doesn’t change (no E movement)
- The main extruder remains constantly connected to the motion queue

## Impact

This bug prevents reliable filament runout detection in multi-extruder setups using motion sensors, which is a critical safety feature for unattended printing.

## Request

Please investigate the interaction between `SYNC_EXTRUDER_MOTION` operations and filament motion sensor state management. The sensor state should only be affected by actual filament movement through the sensor, not by motion queue reconfiguration operations.

---

<div class="post-metadata">

**Author:** ![cardoc](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cardoc](https://klipper.discourse.group/u/cardoc)\
**Post date:** [September 1, 2025, 6:20pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/2 "2025-09-01T18:20:31Z")

</div>

> [@rozarh](#):
>
> BTT Smart Filament Sensor Module v1.0 (SFSM)

> [@rozarh](#):
>
> When changing sensor type from `filament_motion_sensor` to `filament_switch_sensor`, the sensor works correctly - showing cyclical detected/empty state changes when manually moving filament inside the sensor. This confirms the hardware is functioning properly.
> 
> ## Suspected Root Cause

If I’m not mistaken the BTT module has 2 outputs. Are you moving wires when you change sensor type?

---

<div class="post-metadata">

**Author:** ![rozarh](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@rozarh](https://klipper.discourse.group/u/rozarh)\
**Post date:** [September 1, 2025, 6:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/3 "2025-09-01T18:40:32Z")

</div>

No. This sensor (v1, not v2) only has an encoder. The manual specifies three pins on the connector: V, GND, and Signal. Only v2 introduced a separate binary signal for filament presence.

I have this one: [smart-filament-detection-module/V1.0/manual/smart filament sensor module manual201125.pdf at master · bigtreetech/smart-filament-detection-module · GitHub](https://github.com/bigtreetech/smart-filament-detection-module/blob/master/V1.0/manual/smart%20filament%20sensor%20module%20manual201125.pdf)

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [September 1, 2025, 7:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/4 "2025-09-01T19:40:27Z")

</div>

> [@rozarh](#):
>
> reprapy.pl - Zaloguj się

Welcome rozarh,

doesn’t help. I can’t log in!

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [September 2, 2025, 5:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/6 "2025-09-02T17:40:32Z")

</div>

This seems not a bug but a “by design”:

- The motion run-out sensor is only evaluated during printing, aka extrusion moves
- A run-out is detected if a certain distance **should have** passed the sensor but no matching pulses have been received
- After raising a run-out condition, it is only reset when again the moving filament is creating pulses → There is no reset command or anything like this

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [November 1, 2025, 5:40pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-malfunction-with-multiple-extruder-configuration/24730/7 "2025-11-01T17:40:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
