Multiple Extruders: custom G-code additon before change #547

ahmetcemturan opened this Issue Jul 20, 2012 · 8 comments


None yet
4 participants

I think it would be useful to have the option to add some custom gcode when the extruder changes.
Having it only at the start would be OK as obviously the start of the second one is the end of the first one..


alexrj commented Jul 20, 2012

Yeah, I'm holding this because I want to understand what's needed better (see for example the recent talk on the reprap-dev mailing list).

I concur. This would be extremely useful and flexible with multiple extruders on any printer. How whosawhatsis discribes (#633) would be very easy to come up with our own g-code for whatever machine. I would add that a temperature token would be need too in addition to the before & after tool heads number.

Any new ideas or progress on this? This is the only feature holding use back for quality dual extrusion printing.


alexrj commented Dec 17, 2012

@Deezmaker, I hope you don't mind if I put the snippet you sent to me via e-mail, for reference:

G1 X0 Y0; go to wipe area
M104 S100 T<nozzle_last>;  cool down previous nozzle to prevent drool
(do some..retracting here maybe)
M109 S<nozzle_next_temp> T<nozzle_next>;  wait for nozzle to heat up
(then...wiping stuff...etc.)

This feature will be added very soon.


alexrj commented Dec 23, 2012

Regarding the above snippet, note that retraction before toolchange is a built-in feature so you don't need to do it explicitly.

@alexrj alexrj added a commit that referenced this issue Dec 23, 2012

@alexrj alexrj New toolchange_gcode option. #547 e59ed7e

alexrj commented Dec 23, 2012

Done, I implemented the toolchange_gcode option, where you can use the [previous_extruder] and [next_extruder] placeholders. For temperature you can nest placeholders this way: [temperature_[next_extruder]].

alexrj closed this Dec 23, 2012


This is the best Christmas present I got this year! I haven't tried it yet, but I'm sure it'll work great. You are awesome!!! Thank you!

Diego (Deezmaker)

Makers of the Bukobot

On Dec 23, 2012, at 7:32 AM, Alessandro Ranellucci wrote:

Done, I implemented the toolchange_gcode option, where you can use the [previous_extruder] and [next_extruder] placeholders. For temperature you can nest placeholders this way: [temperature_[next_extruder]].

Reply to this email directly or view it on GitHub.

There is an interaction with this method of dual extrusion printing (i.e., park inactive extruder on tool change) and the "avoid crossing perimeters" feature which has been added since the addition of the above feature. Rather than moving directly to the start of the new material extrusion, the new tool head returns to the previous position to continue to travel across the old material. The problem is that Slic3r is not aware that the tool head has been moved by the custom code (i.e., parked) and therefore should move in a different path to avoid crossing perimeters. Ideally there is some general way that parking of heads on tool changes can be supported - or a feature that the custom code can tell Slic3r where the head has been moved to. Does this sound worthwhile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment