Z-lift with tool change (Prusa slicer)

I’m using Prusa Slicer and I want a z-lift (Z-hop) just before a tool change when printing a dual color/material object.
At the moment it simply moves the head straight over the print area scraping the just printed layer.
It does a z-hop before it moves after a retraction but that doesn’t happen with a tool change when it does retracts the filament before it parks the head. This baffles me.
Does anyone have an idea how to do this?

Im thinking maybe add to the beginning of the tool change gcode:

G91
G1 Z{numeric value}
G90

let me know if works! :face_with_monocle:

Nop, that didn’t work. A strange thing happens when I place either at the beginning or end of the change code, there is no extrusion when the first head starts to move on the first layer…
When I remove the extra code extrusion functions normally.
here’s what Tool Change code there already is in Prusa Slicer:

; <<< Tool Change T[previous_extruder]
;***** Update : 20221222

; Tool Change T[next_extruder] >>>
; ----- current_extruder: [current_extruder]
; ----- previous_extruder: [previous_extruder]
; ----- next_extruder: [next_extruder]
; ----- toolchange_z: [toolchange_z]
; ----- layer_z: [layer_z]
; ----- layer_num: [layer_num]

{if next_extruder != current_extruder }
T{next_extruder}
M2000 S200 V250 A6000
M204 S6000
M109 S{if layer_num<1}[first_layer_temperature]{else}[temperature]{endif} C3 W1 ;wait T{next_extruder}
{endif}
M105 ;report temperature

Hi! Can you attach your edited version that does not work. Maybe you did some mistake.

Who knows what this c3 w1 means? Some snapmaker fork additions? Did not find info at marlin docs

Well I tried this as was suggested:

; <<< Tool Change T[previous_extruder]
;***** Update : 20221222

; Tool Change T[next_extruder] >>>
; ----- current_extruder: [current_extruder]
; ----- previous_extruder: [previous_extruder]
; ----- next_extruder: [next_extruder]
; ----- toolchange_z: [toolchange_z]
; ----- layer_z: [layer_z]
; ----- layer_num: [layer_num]

G91
G1 Z2
G90
{if next_extruder != current_extruder }
T{next_extruder}
M2000 S200 V250 A6000
M204 S6000
M109 S{if layer_num<1}[first_layer_temperature]{else}[temperature]{endif} C3 W1 ;wait T{next_extruder}
{endif}
M105 ;report temperature

Found this on this same forum:

M109 S190 C3 W1, wait for the temperature to 190, within 1 second to detect the temperature within the range of ±3 will directly pass. Without these parameters, PID would up to 200 before passing.

Maybe there is a way to change the red marked line. I‘m having the same issue and am trying to resolve this :sweat_smile:

for anyone still looking for this just add
G1 Z{layer_z+“Desired Z hop distance here”} ;
to the tool change G code

1 Like

Hey, could You tell me where excatly to put in the code?
If I put it in the top the first layer doesnt have any extrusion and if i put it at the end prusaslicer wont slice it because of an error.

Thanks :slight_smile:

First line in the ‘Tool change G-code’

2 Likes

Thanks :+1:

Thanks a lot I was getting crazy with a crazy thing here where the code skip layers and separate them… not sure why that happened cuz all was working properly by adding on filament change tool this:
G91
G1 E-1.5 F6500
G1 Z8 Y8 F3000 ; Set to whatever clearance required.
G90


I wasn’t able to get that g-code work correctly, until I found this! Previous days all was working correctly!


Later Edit…

And not pretty sure how or why this happens, its not happening above the models anymore but in the purge tower. This is weird!


If someone has a clue about it please let me know!
I am using an SM2 A250 with a dual extruder

Simply move the z position back by your clearance before moving on?

The 3. picture, you posted on the bottom, shows a feature of prusa. This single line does something but I can’t remember, it was part of tips and tricks section of prusa slicer.

Edited quote:

I guess there is also a syntax “next_position” but not sure right now…

I was digging into that yesterday and after some try’s I modify the code. I use Orca Slicer, I was a previous cura user but was having a hard time tuning filaments, so I decide to get into Orca Slicer. First I tried Snapmaker Orca but then fall in love with Orca Slicer… anyways… I found out that my code: G1 Z{layer_z+8} X30 Y240 F4500 actually works without braking the layers or getting or keeping them to skip. That fix my problem, that code I use for any filament change, so the head goes first to Y240 in order to perform the tool change, what I like from Orca Slicer and these based slicers are that you are able to move the wipe tower to whatever place you would like by hand and not adding coordinates and guessing where it exactly is!


POST EDIT:
Playing around with this and talking to some people at github from Orca Slicer, definitely this is the best way or the best code to add to the first line.
G1 Z{layer_z+2.3} X{wipe_tower_x[0]} Y{wipe_tower_y[0]} F4500
That above is the one I use, change the layer_z+XX to the desired and the wipe tower leave at 0 so the nozzle goes straight where you place the wipe tower without guessing coordinates or something. With this you avoid the dual extruder to make the tool change over the print and it does the change over the wipe tower. Hopefully this might help a lot of people… By the way! try orca slicer, you will like it!