Have you ever returned to a print to find that it didn't print the last layers do to the filament running out or it snapped? Maybe you know you don't have enough on the end of a roll, but don't want to waste it. Well adding a filament runout sensor to your Robo will allow you to print without worrying about ruining your print because you didn't have enough filament. This technique uses an already available command called M600 used for changing filament using an LCD. M600 is also a great way to change colors of filament between layers. You might have used it on your LCD controller with the standard Robo flavored versions of Marlin. Looking to the future, and the use of Marlin 1.1.0, we now have logic for a filament runout sensor. Not only does it work, but it works remarkable well. The printer will just wait for you (beeping) until you change the filament out and resume the print. How it handles the change of filament is all defined around the M600 settings that are in your control in the firmware. I'll explain how to set it all up for you here. Sorry in advance being long, but it really is easy as pie. Also understand I didn't magically come up with all of this. I just saw the code in the firmware, did some research, designed an enclosure, and put it all together here for anyone to benefit from the slick upgrade to their Robo printer. Things you will need: The latest Marlin 1.1.0 for the Robo3d - see downloads in this thread 1 Optical endstop sensor - I bought a 3pk but here is a single 2 #4x1/2" phillips pan head self tapping screws or equivalent LCD Controller - either the XXL or Full Graphics to enable M600 Optionally you may need some 22 awg stranded wire to extend what comes with the sensor Holder for sensor - Mine is available on Thingiverse found here Firmware Changes Needed: The option for the FRS is not available in the current firmware offerings that Robo has posted on their site. The latest firmware from Marlin that @WheresWaldo has been maintaining for the community is needed for this to work. See my link above and choose your correct version and if you want to stay with the ABL or the new MESH leveling version. Just 3 easy changes in the firmware. Please always make sure to have a backup of the firmware you are currently running to revert back if needed. First thing is to make sure you have the Filament Change routines enabled. @WheresWaldo recently uncommented the definition to enable this on the latest versions of his files. I will post the code here as well. Please note my changes to lines indicated with ROBO-DANZ-FC. The stock settings are more suited for Bowden setups on Deltas. Feel free to tweak to your liking, but I found these settings to work best for me. You also need to have an LCD controller for this to be seen. Configuration_adv.h - Enabling Filament Change Feature Code: // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) #define FILAMENT_CHANGE_FEATURE //--ROBO-DANZ-FC Enable filament exchange menu and M600 g-code (used for runout sensor too) #if ENABLED(FILAMENT_CHANGE_FEATURE) #define FILAMENT_CHANGE_X_POS 114 //--ROBO-DANZ-FC X position of hotend #define FILAMENT_CHANGE_Y_POS 10 //--ROBO-DANZ-FC Y position of hotend #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm // It is a short retract used immediately after print interrupt before move to filament exchange position #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s #define FILAMENT_CHANGE_UNLOAD_LENGTH 50 //--ROBO-DANZ-FC Unload filament length from hotend in mm // Longer length for bowden printers to unload filament from whole bowden tube, // shorter lenght for printers without bowden to unload filament from extruder only, // 0 to disable unloading for manual unloading #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, // Short or zero length for printers without bowden where loading is not used #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast #define FILAMENT_CHANGE_EXTRUDE_LENGTH 35 //--ROBO-DANZ-FC Extrude filament length in mm after filament is load over the hotend, // 0 to disable for manual extrusion // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, // or until outcoming filament color is not clear for filament color change #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif Second we need to enable the filament runout sensor routines. Here you just need to remove the // in front of the definition line as indicated with ROBO-DANZ-FRS. The rest stays the same. You can see the script it calls when triggered is the M600 command that we now have enabled by defining the FILAMENT_CHANGE_FEATURE above. Configuration.h - Filament Runout Sensor Code: //=========================================================================== //========================= Filament Runout Sensor ========================== //=========================================================================== #define FILAMENT_RUNOUT_SENSOR // ROBO-DANZ-FRS Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament // RAMPS-based boards use SERVO3_PIN. For other boards you may need to define FIL_RUNOUT_PIN. // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif The third and final change is to assign the pin on the RAMPS we are using for the optical sensor. We are using pin 20 with this setup. I am not using pin 4 because that is being used for my RRD Fan Extender mod found here. Also, using Servo pin D4 being analog is not ideal for this setup and I find D20 a better setup for a digital setup. pins_RAMPS.h Code: // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #define FIL_RUNOUT_PIN 20 // ROBO-DANZ-FRS Default is D4, but needed this digital input An optional change is to enable PINS_DEBUGGING in Configuration_adv.h by removing the // in front. This makes the command M43 available for debugging and testing the FRS using M43 P20 to return the state of the endstop with a 0 or 1. Can also be useful for debugging other pins. Configuration_adv.h Code: /** * Add M43 command for pins info and testing */ #define PINS_DEBUGGING //--ROBO-DANZ Hooking Things Up: Hooking things up is very straight forward. However, if you own the R1+ with the slightly customized RAMPS configuration, Robo decided to not have any headers soldered in that are not used. We will be using D20 pins for this setup and you would need to solder in a 1x3 pin header for this to work. The optical endstop has 3 connections. VCC or V or + that is the 5V lead (red), SIG or S for the signal (yellow), and GND or G or - that is the ground (black). Below is a section of the RAMPS schematic depicting the upper right area where the X, Y, and Z endstops are plugged in. You will see where D20 pin has the red, black, and yellow dots indicating where the leads need to run from the optical sensor. As I have noted already, you may need to replace or lengthen the leads with 22 AWG stranded wire to reach you selected mounting point. More about where to mount this later. Assembly: Using my enclosure for the optical sensor you just need to assemble the pieces needed and decide if you want to put the sensor inline prior to going into the top slot of the Robo case or to sit on top of the Greg's Wade extruder. Either option works fine. I designed this to be fairly generic and can be used on any printer really and it also is short enough not to interfere with Z height. A few pics here for reference. The model files can be pulled off of my Thingiverse page found here. I've included the source files as well if you want to make any modifications like adding a filament cleaner/oiler so that it is all one assembly. Note Worthy Items: When making changes to the RAMPS, please always unplug power and USB to be safe. Make sure routing of the new wires are properly secured and out of the way from normal operation. This can also be easily done with a mechanical endstop, but I wanted something that had no contact with the filament for the least amount of resistance. It is also far less bulky. Designs for an enclosure for this can be found on Thingiverse. Debugging and testing is fairly easy when you enable PINS_DEBUGGING in the firmware explained above and using M43 P20 to get a 0 or 1 returned telling if the sensor is triggered or not. You also don't always have to have the FRS in place. You can run the filament as usual and just put a small piece of filament in the enclosure to make the printer think it has filament. This may not work the best with transparent types of filament. A mechanical endstop would be more suited for those types of filament if you use them often. You are not required to print via SD card for this to work. You can still print via USB. The LCD is still required for response to the filament change routine. There is also a filament width sensor feature available in the new Marlin versions. It is not the same as this. I can look into implementing if anyone is interested. I hope you find this modification useful. Happy printing and Cheers!