Howto: Pause Repetier for filament reload at a specific layer number

Last year I posted Howto: Pause Marlin for filament reload at a specific layer number.  Since then I upgraded (I consider it an upgrade) to Repetier, and wanted to do the same thing.

The above link has a chunk of G and M codes  that could be inserted into the .gcode script at a given line number to pause it, allowing you to do a filament reload by hand. I figured you could do the same thing in Repetier.  As it turns out you can, and actually it’s a lot easier… presuming it works in the first place:

Repetier allows you to ‘Reload Filament’ via the LCD.  However, I immediately ran into a problem:  After the reload, it wouldn’t return to the correct position on the build plate:  It was always offset by some amount.  Basically ruining the print every time I tried.  Long story short:  You need to configure the firmware to “not home” after filament reload.  Two ways to do this:

Via the online configuration tool:  In the features tab under the “Filament Change” section, I set the “Homing after Filament Change” to “No Homing”.

Or in your Configuration.h set:

#define FILAMENTCHANGE_REHOME 0

Now, I can reload filament successfully via the LCD.

And via the M600 Mcode:  Up until then, whenever I’d try this code (which starts the filament reload process the LCD uses) I’d run into the exact same problem.  But now it works, so we can add it to our gcode file.

Why was this needed though?  You can follow the play-by-play on the Repetier firmware form here, but in a nutshell:  In my ‘start gcode’, I move my toolhead to the corner of my buildplate and ‘zero’ it there.  During Repetier’s ‘rehome’ operation during the reoload, it basically nukes those coordinates, thus putting an offset into my print.

Repetier’s ‘reload filament’ code is so simple (just that one line) compared to Marlin, you can easily enough by hand go into your gcode file, find the line number like this:

; layer 4, Z = 0.78

And insert it in where needed:

M600
; layer 4, Z = 0.78

Or, like mentioned in the previous post, you can use your slicer software (if it supports it) to post-process the gcode to add this in where you need.  Snip from last years post:

I slice using Simplify3D:  In a given process, it has a section in its ‘Scripts’ tab, at the bottom, called ‘Additional terminal commands for post processing’.  This allows you to enter in script to do a text-replace in your file, to edit it for you.  I learned about it on a forum post here.

To do the above using that system, you’d need to enter this text into that field:

{STRIP ";   postProcessing,"}
{REPLACE "; layer 4," "M600\n; layer 4,"}

And (like last years post),  some really important things to note:

  • The fist line that says ‘STRIP’ is super important:  If you don’t do this, Simplify3D will embed a copy of the REPLACE line in the header of the gcode, but won’t properly comment it out, basically ruining the gcode.
  • In the STRIP line, there needs to be exactly three spaces between the semicolon ‘;’ and the ‘postProcessing text.  Any more or less will screw up the strip.  If you copy-paste this code, make sure there are three spaces in there.
  • As you can see, you need to insert newline characters (\n) into the string you’re building for it to show up properly in the gcode later.

I have been made aware that you can also do something similar via Repetier Host:  The goal of this is to print entirely untethered, with precisely defined pause-points in the code for filament change, so host software (Repetier or otherwise) is out  of the question what what I’m trying to solve.

Building the C-Bot 3d Printer : Part 32 : New Cooling Fan shroud, and bulldog clips
Building the C-Bot 3d Printer : Part 33 : Machining a mic6 aluminum removable build plate
  • Trackback are closed
  • Comments (1)
    • Mark
    • December 3rd, 2017 4:29pm

    I just did this on my delta printer, running Repitier 1.0Dev level. Works Perfect. I just edited the gcode file to the layer I wanted, added the M600 gcode. Hard to get any easier.

    (I did also change the Filament change z lift setting to 20 so I can have a little room to catch the new filament dribbles. )

    Thank you.

Comment are closed.