# Filament\_motion\_sensor not working with extruder\_stepper

**URL:** <https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742>\
**Category:** General Discussion\
**Created:** [September 2, 2025, 10:32pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742 "2025-09-02T22:32:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshua70448](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/joshua70448/32/20411_2.png) [@joshua70448](https://klipper.discourse.group/u/joshua70448)\
**Post date:** [September 2, 2025, 10:32pm UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/1 "2025-09-02T22:32:45Z")

</div>

### Basic Information:

Printer Model: Modded Ender 3 v2  
 MCU / Printerboard: Octopus v1.1  
 Host / SBC: Raspberry PI 4B  
 klippy.log

[klippy.log](https://klipper.discourse.group/uploads/short-url/iX3JuuUTK3eMG6rGXrb7PvmxrmA.log) (3.5 MB)

### Describe your issue:

I’ve got 4 extruders connected to a single hotend. The first extruder is defined as an `extruder` object, and the others are defined as `extruder_stepper` objects. I’ve got some BTT smart filament sensors (v2) that I’d like to add to each extruder. The first one works fine, but when I try to add the second one I get this error:

`Internal error during ready callback: 'PrinterExtruderStepper' object has no attribute 'find_past_position'`

I saw a [similar post from last May](https://klipper.discourse.group/t/filament-motion-sensor-on-2-in-1-out-hotend/16617/5) with a solution involving adding the missing `find_past_position` method to the `PrinterExtruderStepper` class. The author said they might submit a PR to add this fix to the code base, but it doesn’t look like this was done.

Is there a better way to configure filament motion sensors on `extruder_stepper` objects? Should the fix suggested in that post get committed and merged? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nefelim4ag](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/nefelim4ag/32/2387_2.png) [@nefelim4ag](https://klipper.discourse.group/u/nefelim4ag)\
**Post date:** [September 3, 2025, 12:43am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/2 "2025-09-03T00:43:23Z")

</div>

Unfortunately, the log file is missing the Klipper version and seems modified.  
Regardless, the method exists in the mainline.  
So, you probably have to update to a more recent release than the one you have.

```auto
d77928b17b klippy/kinematics/extruder.py (Kevin O'Connor 2021-02-22 21:38:33 -0500 257) def find_past_position(self, print_time):
6627d036ac klippy/kinematics/extruder.py (Kevin O'Connor 2022-02-21 13:51:27 -0500 258) if self.extruder_stepper is None:
6627d036ac klippy/kinematics/extruder.py (Kevin O'Connor 2022-02-21 13:51:27 -0500 259) return 0.
ffbd2698fe klippy/kinematics/extruder.py (Kevin O'Connor 2022-01-11 14:21:57 -0500 260) return self.extruder_stepper.find_past_position(print_time)

```

Hope that helps.

* * *

Ah, well, you probably right.  
But it is strange, you do request the extruder, not the `extruder_stepper`

Hmmm.

* * *

Aaah, there is more then one filament\_motion\_sensor

---

<div class="post-metadata">

**Author:** ![joshua70448](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/joshua70448/32/20411_2.png) [@joshua70448](https://klipper.discourse.group/u/joshua70448)\
**Post date:** [September 3, 2025, 1:02am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/3 "2025-09-03T01:02:37Z")

</div>

Ah sorry, I was trying to focus the log on the error itself, here’s the unmodified log. As for the release being outdated, I’m on v0.12.0-159 which is admittedly a bit old, but the problem seems to be with the `PrinterExtruderStepper` class used by `extruder_stepper` (as opposed to the `ExtruderStepper` class you’ve referenced, which my first extruder uses without any issues). The [source for the PrinterExtruderStepper class](https://github.com/Klipper3d/klipper/blob/master/klippy/extras/extruder_stepper.py) hasn’t been updated in 3 years so I’m wary of updating unless I know it’ll fix the problem.

[klippy.log](https://klipper.discourse.group/uploads/short-url/iX3JuuUTK3eMG6rGXrb7PvmxrmA.log) (3.5 MB)

---

<div class="post-metadata">

**Author:** ![joshua70448](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/joshua70448/32/20411_2.png) [@joshua70448](https://klipper.discourse.group/u/joshua70448)\
**Post date:** [September 3, 2025, 1:04am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/4 "2025-09-03T01:04:48Z")

</div>

> [@nefelim4ag](#):
>
> Aaah, there is more then one filament\_motion\_sensor

Haha yeah, the first `filament_motion_sensor` works like a charm, it’s the additional sensors that aren’t playing nicely.

---

<div class="post-metadata">

**Author:** ![joshua70448](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/joshua70448/32/20411_2.png) [@joshua70448](https://klipper.discourse.group/u/joshua70448)\
**Post date:** [September 3, 2025, 1:09am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/5 "2025-09-03T01:09:38Z")

</div>

Here’s the pertinent config, if it helps any:

```auto
# Extruder 0
# Driver = DRIVER4 / MOTOR4
# Heater = HE0
# Thermistor = T0
# Runout = DIAG4
[extruder]
max_extrude_only_distance: 450
max_extrude_cross_section: 2
step_pin: PF9
dir_pin: PF10
enable_pin: !PG2
microsteps: 16
rotation_distance: 22.725 # 22.748
nozzle_diameter: 0.800
filament_diameter: 1.750
heater_pin: PA2
sensor_pin: PF4
sensor_type: EPCOS 100K B57560G104F
#control: pid
# tuned for stock hardware with 200 degree Celsius target
#pid_Kp: 28.22
#pid_Ki: 3.12
#pid_Kd: 63.77
min_temp: 0
max_temp: 240
# PLA 0.4mm nozzle = 0.6944
#pressure_advance: 0.6944

[tmc2209 extruder]
uart_pin: PF2
run_current: 0.800
stealthchop_threshold: 999999

[filament_switch_sensor runout_switch]
switch_pin: PG11

[filament_motion_sensor runout_encoder]
switch_pin: PG10
detection_length: 4
extruder: extruder

# Extruder 1
# Driver = DRIVER5 / MOTOR5
# Runout = DIAG5
[extruder_stepper extruder1]
extruder: # If blank, not synchronized
step_pin: PC13
dir_pin: PF0
enable_pin: !PF1
rotation_distance: 22.725 # 22.748
microsteps: 16

[tmc2209 extruder_stepper extruder1]
uart_pin: PE4
run_current: 0.800
stealthchop_threshold: 999999

[filament_switch_sensor runout_switch1]
switch_pin: PF6

[filament_motion_sensor runout_encoder1]
switch_pin: PF5
detection_length: 4
extruder: extruder_stepper extruder1

```

`extruder` is the first extruder motor, which is tied to `runout_switch` and `runout_encoder` and works without any problems. `extruder1` is the second extruder motor, which is tied to `runout_switch1` and `runout_encoder1`. The switch sensor is fine, but the motion sensor throws the error. If I use `extruder: extruder1` then it complains that the config object doesn’t exist.

---

<div class="post-metadata">

**Author:** ![nefelim4ag](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/nefelim4ag/32/2387_2.png) [@nefelim4ag](https://klipper.discourse.group/u/nefelim4ag)\
**Post date:** [September 3, 2025, 1:25am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/6 "2025-09-03T01:25:20Z")

</div>

Yes, I can reproduce that locally, I look for what can be done.

This seems correct:

```auto
diff --git a/klippy/extras/extruder_stepper.py b/klippy/extras/extruder_stepper.py
index 4ac5289f8..79d4feef8 100644
--- a/klippy/extras/extruder_stepper.py
+++ b/klippy/extras/extruder_stepper.py
@@ -15,6 +15,10 @@ class PrinterExtruderStepper:
                                             self.handle_connect)
     def handle_connect(self):
         self.extruder_stepper.sync_to_extruder(self.extruder_name)
+ def find_past_position(self, print_time):
+ return self.extruder_stepper.find_past_position(print_time)
+ def sync_to_extruder(self, extruder_name):
+ return self.extruder_stepper.sync_to_extruder(extruder_name)
     def get_status(self, eventtime):
         return self.extruder_stepper.get_status(eventtime)

```

~~I will make an PR~~ : [extruder\_stepper: define missing public methods methods by nefelim4ag · Pull Request #7032 · Klipper3d/klipper · GitHub](https://github.com/Klipper3d/klipper/pull/7032)

Thanks for the report.

---

<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:** [October 3, 2025, 11:25am UTC](https://klipper.discourse.group/t/filament-motion-sensor-not-working-with-extruder-stepper/24742/7 "2025-10-03T11:25:37Z")

</div>

Closed on October 3, 2025, 11:25am UTC

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