Modifying the “Pause at Height” Cura Plugin for Printrbot Plus

Recently I did some 3D printing objects as a kind of diorama that I photographed for my 2016 Christmas card. One of the objects was this sign saying “Emmanuel – God Is with Us”. The background or base of the object was printed in brown filament and the raised lettering was printed in white filament. I use a single extruder Printrbot Metal Plus.

The trick to printing this is to print the brown portion, get the printer to pause while you change filaments, and then print the white lettering raised above it. I’m using Cura 15.04 which is the most recent version that can be easily configured for Printrbot. It has a plugin called “Pause at Height” that is designed to allow you to do just what I want. You pick a Z height at which the printhead is retracted and paused while you swap the filaments.

If you open Cura and click on the “Plugins” tab you will see the following:

There are two plugins installed by default. The one we are interested in is Pause at Height. You click on the plugin and then click on the tiny down arrow at the bottom of the window and a dialog will appear that allows you to set the parameters for the plugin. It will look like this…

It gives you a series of parameters that you can fill out. Then when you print your object, theoretically the printer will pause and allow you to change filaments. Unfortunately the Printrbot Metal Plus does not have any sort of control panel so there’s no way to resume the print once you’ve paused. I tried using the plugin anyway just to see what would happen. At the proper point in the print, the printhead retracts back and to the side as it’s supposed to. But rather than pausing, it immediately goes back where it left off and begins printing.

If you look at the lower left corner of the plugin screen you will see a button that says “Open plugin location”. If you click on that button here’s what the folder looks like in Windows Explorer.

You can see the plugins are actually Python programs that have a .py extension. We want to look at the one named “pauseAtZ.py”. We will open it up in our favorite text editor and take a look around. If you look at the code at approximately line 104 you will see this

It appears that this Python script is reading and writing your G-code looking for the proper place to do the pause. Then it inserts additional G-code to do the retraction and the actual pause. The important line is line number 110 which inserts the G-code command “M0”. This is a stop command as described here
http://www.reprap.org/wiki/G-code#M0:_Stop_or_Unconditional_stop
Apparently the firmware in the Printrbot Metal Plus does not recognize that particular G-code. There are other G-code options that we can substitute.

Using your text editor, do a “save as” and give it a different filename with a .py extension and save it in the same folder as the original. Modify line number 110 to read as follows

The “G4” command is described here
http://www.reprap.org/wiki/G-code#G4:_Dwell
It causes a 30 second pause. I found that this gives me sufficient time to withdraw the original filament, replace it with a different color, and force some of the new filament through the nozzle to flush out the old color.

There is one other change you should make in that file. On the very first line it reads:

This is the name that appears in the plugin tab of Cura. You should change this name to something like

so that you can distinguish it from the original plugin.

I made those changes, selected the modified plugin and it worked perfectly. You have to play around with the preview slicing to determine what level you need to set for the pause. You might try printing a small test piece if your object is extremely large.

Leave a Reply

Your email address will not be published. Required fields are marked *