Implementing a filament motion sensor for the Core One
 
Notifications
Clear all

Implementing a filament motion sensor for the Core One  

  RSS
hyiger
(@hyiger)
Noble Member
Implementing a filament motion sensor for the Core One

Started to get annoyed with ruined prints caused by filament tangles and nozzle clogs. I thought: "Why doesn't the Core One have a way to detect this?" The Buddy Board (and Marlin) have only filament runout detection (as far as I'm aware). 

So I picked up a BTT SFS V2.0 Smart Filament Sensor for $14 USD. It has 2 sensors. A filament run-out switch and a motion sensor. These are split out with 2 signals, both active high with the run-out signal active high and the motion sensor a square wave also active high, both 3V3 logic levels. The sensor itself can be powered from 5VDC or 3.3VDC. So to test this out I plugged it into the GPIO header of my RasberryPi 5 running OctoPrint. The run-out detection on GPIO 27 and the motion detection on GPIO 26

The device itself inlines nicely onto the end of the Bowden 

There is an OctoPrint plugin: Octoprint-Filament-Motion-Sensor which is supposed to send a pause to the printer when it detects the filament is not moving. Testing the plugin appears to work. But it keeps shutting itself down. I've only started playing around with it but I may end up having to write my own. 

 

 

 

 

Publié : 20/12/2025 10:06 pm
1 personnes ont aimé
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE: Implementing a filament motion sensor for the Core One

I'm using a Raspberry Pi and OctoPrint for prototyping but I doubt people will necessarily want to spend the time and money needed to fully set this up. Once I get something working I'll move it over to a dedicated microcontroller add-on. At the moment, thinking about the best way to interface it with the printer. I keep coming back to just attaching it to the serial port. 

  1. A microcontroller that supports serial over USB-C. Both the controller board and sensor can be powered from the USB-C serial interface on the printer. 
    1. Ideally both the sensor and controller are in the same housing with a single USB cable back to the printer. 
  2. Missing pulse detector automatically configurable by current print speeds (can query this over the serial interface) 
  3. Sends a pause/filament change command to the printer: M600 (I would assume)
  4. Monitor the serial connection and when printing resumes reset the detector

 

Publié : 20/12/2025 10:30 pm
2 personnes ont aimé
Geoff Steele
(@geoff-steele)
Trusted Member
RE: Implementing a filament motion sensor for the Core One

Am I right in thinking it goes on the static spool end rather than the print head due to size/weight that would be added to the moving part? Or is that a specific limitation of the sensor? 

Reason for asking is the use case with INDX / MMU

Publié : 20/12/2025 11:18 pm
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE: Implementing a filament motion sensor for the Core One

 

Posted by: @geoff-steele

Am I right in thinking it goes on the static spool end rather than the print head due to size/weight that would be added to the moving part? Or is that a specific limitation of the sensor? 

Reason for asking is the use case with INDX / MMU

I would think the best place to mount it would be closest to the spool. It could theoretically be mounted above the printhead but I'm not sure there would be enough clearance for the Bowden tube and the lid. In the case of the MMU (which I'm not familiar with) I suppose it would need to be mounted just after it demultiplexes into a single Bowden. I suppose for an INDX system you would need N copies, 1 for each head. 

Anyway, still at the very early stages of playing around with it. 

Publié : 21/12/2025 12:59 am
1 personnes ont aimé
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE: Implementing a filament motion sensor for the Core One

I also thought about attaching it to the side sensor cabling but then I would need somewhat to signal back to it in order to enable and reset. Could use the GPIO board for this but seems a bit complicated. Prefer to avoid having to inject custom g-code in the slicer if possible. 

Publié : 21/12/2025 1:02 am
NickAtNight
(@nickatnight)
Estimable Member
RE: Implementing a filament motion sensor for the Core One

Interesting concept.   

Have you thought of some way to use the camera to detect for a failed print?   Such as:
   - if the model detaches from the base.
   - or if stringing starts

Publié : 21/12/2025 1:16 am
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE: Implementing a filament motion sensor for the Core One

 

Posted by: @nickatnight

Interesting concept.   

Have you thought of some way to use the camera to detect for a failed print?   Such as:
   - if the model detaches from the base.
   - or if stringing starts

Yep, the easiest way to implement that is to buy a Bamboo labs printer. 

Publié : 21/12/2025 1:34 am
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE: Implementing a filament motion sensor for the Core One

Making progress. Wrote a Python script to enable the sensor and reset the watchdog timer on layer change then it will send a change filament command M600 to the printer when it detects the filament hasn't moved in 5 seconds. Next is to figure out how to vary the missing pulse detection based on the print speed. Will translate this over to an ESP breakout board that arrives tomorrow. 

$ sudo python3 detect_snag.py 
SFS V2.0 Monitoring on GPIO 26...
Filament Speed: 0.00 mm/s
Filament Speed: 278.50 mm/s
Filament Speed: 323.42 mm/s
Filament Speed: 283.66 mm/s
Filament Speed: 159.78 mm/s
Filament Speed: 278.52 mm/s
Filament Speed: 78.04 mm/s
Filament Speed: 0.00 mm/s
Filament Speed: 0.00 mm/s
Filament Speed: 0.00 mm/s
Filament Speed: 0.00 mm/s
!!! FILAMENT JAM DETECTED !!! Sent M600. Printer Paused.
Filament Speed: 0.00 mm/s
Filament Speed: 0.00 mm/s
Publié : 21/12/2025 6:25 am
hyiger
(@hyiger)
Noble Member
Topic starter answered:
RE:

In case you are wondering above why the filament speed is erratic, I was pulling it by hand through the sensor to test. I'm in the process now of building a small controller board and single housing for the unit. I'm also thinking about how this would work in an INDX setup. That will be for later. 

Ce message a été modifié il y a 5 hours par hyiger
Publié : 21/12/2025 5:39 pm
1 personnes ont aimé
Partager :