Octoprint Filament Runout Sensor

Get answers & advice for all of your 3D printing & Free Software needs here!
nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Octoprint Filament Runout Sensor

Post by nuroo » Thu Sep 07, 2017 7:11 pm

Octoprint Filament Run Out Sensor

Updated: Learned alot since this post, scroll down for updated instructions

(I dont know if any one has posted this already. But it was new to me and solves a big problem with a lot of 3d printers so I'm sharing.)

Octoprint is great. I love watching my printers while I'm working. (Octoprint Anywhere pluggin). I love getting picture progress and completion reports on my phone (pushbullet pluggin). Octoprint is just awesome.

Hate almost empty spools of filament laying about because your afraid they cant finish a print?
Do you use new rolls of filament on a big prints because a half empty roll might run out before job is complete?
Or maybe you check constantly, babysitting the printer if a roll is almost finished.
Im done with that. The sensor linked below works with Octoprint to pause a print if filament runs out. Once filament run out is detected, the print head moves away from model and cools down until you change filament. (Filament Sensor Reloaded)
So then come back to printer. Heat up extruder, change filament, extrude a little, hit resume on Taz 6 and then click resume on Octoprint. Then :D
20170907_204214.jpg
The sensor has 3 wires. But you only need red and white for it to work with Octoprint:
Red > GPIO 4, which is pin 7
White > any ground pin (I used pin 6)
filament reloaded (1).jpg
Octoprint gcode scripts:
After print job is cancelled -

Code: Select all

G91; Set to Relative position
G1 E-6 F300; retract the filament a bit before lifting the nozzle
G0 Z50; move z axis up 50
G1 Y150 F5000; move part out for inspection
After print job is paused -

Code: Select all

M600 Z50; pauses print then moves the print head up 50mm so hotend doesn't burn model
So just mount the sensor into the filament path. Connect the wires to Octoprint. Add pluggin to Octoprint. Configure pluggin and reboot Octoprint.

The sensor comes in a 3d printed case. For now I just have it in the filament path, which has worked out so far. Im a noob at designing, but someone can whip up a better implementation. Some1 on thingiverse integrated a different filament sensor into the filament tube, which is awesome.

I think this method is a lot easier than adding the sensor to the printer itself. That would involve modifying the firmware and splicing the sensor into your printers circuit board. Which is a possible warranty issue. Besides Octoprint has so any other benefits this just puts it over the top.
There isn't anything special about the module, it's a standard mechanical endstop housed in a 3d printed case. So you could make your own. Just a matter of positioning the endstop so a break triggers it.


Amazon on Sensor
Last edited by nuroo on Sun Mar 04, 2018 5:50 pm, edited 2 times in total.

nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Re: Octoprint Filament Runout Sensor

Post by nuroo » Tue Nov 14, 2017 8:50 pm

Update:
Now using new firmware (Marlin_TAZ6_SingleExtruder_1.1.5.32_e424c92.hex)
This firmware implements advanced pause:
* Advanced Pause
* Experimental feature for filament change support and for parking the nozzle when paused.
* Adds the GCode M600 for initiating filament change.


So a few changes to post above, but for the better :)

Filament Sensor Reloaded (pluggin page)
Pin 7
Debouce Time: 200 ms
Switch Type: Normally Open
Board Pin Mode: Board Mode
Out of filament GCODE:

Code: Select all

M300 ; beep sound
M600 X220 Y17 Z50 ; move Z up +50, move bed to rear for easy access nozzle 
Pause print when out of filament (UNCHECKED)

GCODE Scripts
After print job is paused

Code: Select all

; M601 ; pause print
Before print job is resumed

Code: Select all

M602 ; Resume print
Demo
https://youtu.be/IB6C0iHMcxc

nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Re: Octoprint Filament Runout Sensor

Post by nuroo » Wed Nov 15, 2017 4:19 pm

Noticed sometimes the printer would get stuck in a loop. It would move down to the print to start printing then immediately pause again.

Trying to figure out the cause of this behavior.
I think it may be the debounce timing of the sensor in the reloaded pluggin
or
me issuing m601 in "After print job is paused" gcode scripts section.
or
me changing the filament b4 the 45 sec timeout to cool nozzle down

Commenting out M601 in "After print job is paused" seems to have fixed the issue.


-----------

So now "After print job is paused" is:

Code: Select all

;M601 ; pause print
G1 E-3
G92 E0;
I'm adding a small retraction to try and combat the blob that forms as the print resumes printing. Seems to work nicely. I'll keep tweaking and report back.

Davec3275
Posts: 8
Joined: Sun Jan 29, 2017 6:25 pm

Re: Octoprint Filament Runout Sensor

Post by Davec3275 » Fri Jan 12, 2018 4:45 pm

Did you mount this sensor to the print head so it won't move? Or is it free floating?

nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Re: Octoprint Filament Runout Sensor

Post by nuroo » Fri Jan 12, 2018 6:28 pm

Its free floating. Works pretty well like that.

I lack the design skills to make a mount for it. But I'm learning slowly.

Davec3275
Posts: 8
Joined: Sun Jan 29, 2017 6:25 pm

Re: Octoprint Filament Runout Sensor

Post by Davec3275 » Fri Jan 12, 2018 10:55 pm

Thanks for the feedback. I just received mine and will be setting it up in the next couple of days. I cannot wait.

Davec3275
Posts: 8
Joined: Sun Jan 29, 2017 6:25 pm

Re: Octoprint Filament Runout Sensor

Post by Davec3275 » Thu Feb 15, 2018 3:15 pm

Nvever mind, I think I found it all.

Okay, so what does your out of filament gcode look like now? I see several different areas and I am not sure where it all goes.

Davec3275
Posts: 8
Joined: Sun Jan 29, 2017 6:25 pm

Re: Octoprint Filament Runout Sensor

Post by Davec3275 » Fri Mar 02, 2018 9:24 am

Do the settings & scripts you have listed work well? Do you still get the looping at times? I just installed mine and it worked great the first test I did, but then the next instance it triggered it just looped. Had to kill the print. That said, my debounce setting on this particular machine was 250 at the time. I have reset it down to the recommended 200 on both machines.

Just wanted to see if I need to be worried about the potential for looping.

nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Re: Octoprint Filament Runout Sensor

Post by nuroo » Fri Mar 02, 2018 10:13 am

I still have this issue every now and then. I don't think it's the firmware or Octoprint debounce. I think the filament path maybe be too loose. Maybe need a way to make sure filament is straight going into the sensor. But It actually happens on all my printers that use an endstop as the dectector. Even cr10 that has a firmware supported filament sensor, no Octoprint involved experiences this.
I wanted to try bending the little metal arm that triggers the sensor inside the housing. Was also considering changing the sensors trigger for normally closed to normally open, or opposite to how every it's wired now. That would involve just changing the wiring on the endstop. But i never tried opening the housing of the sensor case.

nuroo
Posts: 150
Joined: Mon Apr 10, 2017 2:08 pm

Re: Octoprint Filament Runout Sensor

Post by nuroo » Sun Mar 04, 2018 5:38 pm

Davec3275 wrote:
Fri Mar 02, 2018 9:24 am
Do the settings & scripts you have listed work well? Do you still get the looping at times? I just installed mine and it worked great the first test I did, but then the next instance it triggered it just looped. Had to kill the print. That said, my debounce setting on this particular machine was 250 at the time. I have reset it down to the recommended 200 on both machines.

Just wanted to see if I need to be worried about the potential for looping.
OK ok for fuck's sake. I think I found this issue. (hopefully)

Turns out "I" was creating the filament loop at the end filament change....... omg. This was super frustrating. Been playing with this on and off for months.

Seems the culprit was this code in Octroprint's GCODES Scripts section:
Before print job is resumed: M602 ; Resume print

"I" was causing the filament change to be initiated again :roll:
So the 1st pause would be called by a real out of filament condition but then once the filament change finished Octprint executed - "Before print job is resumed: M602 ; Resume print" thus making it do the whole procedure again......thus endless loop. Seems after M600 is completed thru LCD menu, no other action is required - printer will resume print. I thought M602 was needed.

So to be clear-
Octroprints GCODES Scripts section:
Before print job is resumed: ;nothing / empty;

On another note - seems some people also have issues with false positives from endstops as filament detection sensors. So the recommendation is adjusting the debounce timing and to put a capacitor across the endstop leads to filter electrical noise.
https://github.com/MarlinFirmware/Marlin/issues/4059

Sorry......

Post Reply