OrcaSlicer icon indicating copy to clipboard operation
OrcaSlicer copied to clipboard

Always Z lift if possible when commanding a toolchange (T0, T1...), or Always place z coordinate in the next G1 command after a toolchange

Open JuanR3D opened this issue 1 year ago • 5 comments

Is there an existing issue for this feature request?

  • [x] I have searched the existing issues

Is your feature request related to a problem?

When executing a toolchange, OrcaSlicer only generates the T0, T1, etc., commands without performing any Z-lift. This can be dangerous, especially on IDEX machines, but also on any machine where the nozzle might collide with objects such as warped parts or other obstacles. In IDEX setups, the risk is even higher since the inactive nozzle could potentially crash into the print bed during the first layers if there are issues with the bed level or Z offsets.

This situation is similar to when Z-hop is required during travel moves to avoid collisions with supports or other printed parts.

Main problem: Users currently have the option to define Z-lift within the T0 and T1 macros, so the active extruder lifts before parking. However, this introduces another issue that users need to address:

If the user does not move the Z-axis back down after parking the previous extruder, the next G1 command without a specified Z-coordinate will cause the printer to print in the air. If the user moves the Z-axis back down after parking, the new extruder will travel to the print piece at the same height as the previous one, increasing the risk of collisions.

I think This Z-lift behavior during toolchanges should be handled automatically by OrcaSlicer during G-code generation.

Also, something similar has been said here: https://github.com/SoftFever/OrcaSlicer/issues/6773

Which printers will be beneficial to this feature?

All

Describe the solution you'd like

The generated G-code should include a Z-lift before executing the toolchange macros (T0, T1, etc.), and after completing the toolchange, the nozzle should only lower to the print position once the new XY position has been reached.

Example: If we are printing at X135 Y200 Z0.2 with tool T0, and the next print position with tool T1 is X400 Y100 Z0.2, with a Z-lift distance of 0.4 mm, the G-code should follow a sequence like this:

... previous commands G1 X135 Y200 E... ; Move to the last print position with T0 G1 Z0.6 ; Z-lift (raise the nozzle to avoid collisions) ; Retraction of material if needed T1 ; Change from T0 to T1 (park T0 and activate T1) G1 X400 Y100 ; Move to the new XY print position with T1 G1 Z0.2 ; Lower to the printing height ... continue printing with T1

This approach prevents the active extruder from colliding with the part or the bed during the toolchange and ensures that the nozzle only lowers once the correct XY position has been reached.

Describe alternatives you've considered

  1. Customized T0 and T1 macros:

Users can create highly personalized macros to move the extruder to the next print position using parameters like x_after_toolchange, y_after_toolchange, and z_after_toolchange. However, this presents two issues:

The T0 and T1 macros become unnecessarily complex, requiring users to manually handle these movements. For some users, the parameters (x_after_toolchange, etc.) are not working correctly, as seen in this issue.

  1. Custom post-processing scripts:

Users can modify or insert Z-lift commands directly into the G-code using post-processing scripts instead of relying on the T0 and T1 macros.

Neverthless, users shouldn’t have to rely on complex macros or custom scripts to prevent collisions.

Additional context

No response

JuanR3D avatar Feb 03 '25 16:02 JuanR3D

i would also like the possible mention of just being able to hand on coordinates to the toolchange commands. im not sure what xyz after toolchange is supposed to represent right now, but to me it would make sense to be able to provide the T commands with those as a parameter per default. nothing will error if provided, and users will have a standardized way to pass on those coordinates in their setup if required (instead of having multiple way requireing all the sorts of different macros to handle it.)

for example T0 X175 Y175 Z10 as a toolchange command being generated from orca, with XYZ representing the next position after toolchange.

i would like to note that not much of this would be an actual issue if the XYZ after toolchange worked

Contomo avatar Apr 18 '25 15:04 Contomo

is there a G-code for the opposite?... I mean, all this was fixed on last release but when tool change is made on orca (mine is dual extruder from snapmaker) at the time the nozzle gets into the purge tower, there is a "Z-Lift" when ends printing but there is not a "Z-lift" when it does ends printing the purge tower. I have to place the prints with good clearance in order to avoid the nozzle to hit a print when it gets out from printing the purge tower. I have tried a lot of combinations but seems that they do not work on the change filament G-code under Machine G-code. Before the release fix, I was using this code G1 Z{layer_z+4} X{wipe_tower_x[0]} Y{wipe_tower_y[0]} F4500, in order to be able to use No sparse layers on multimaterial tab, but getting this at the end of the G-code makes no change at all, as the change filament g-code is just for that "The tool change" not for the tower print itself. where can the tower be configured? or there is a way that the option can be added in multimaterial tab? Can someone shed a light? By the way, I am just an user, I am not that good at g-codes but I can learn from someone if its explained.

tomas-a-sanchez avatar May 18 '25 08:05 tomas-a-sanchez

Since the issue here differs slightly from the other one, I’d like to add some comments. Orca enforces a Z-lift(if it's enabled in the extruder settings) for multi-extruder machines if multi-tool ramming is enabled in the filament settings. However, if that option is disabled, Orca will not enforce a lift or travel to the wipe tower immediately before a tool change to avoid unnecessary movements. In that case, we expect the machine firmware (or custom tool change G-code) to handle the lift and move the tool head to the parking position for the tool change, then lower it back to the original Z position. This design ensures the slicer provides full flexibility for the firmware to manage optimized tool-changing path and actions.

SoftFever avatar Sep 21 '25 01:09 SoftFever

Thanks @SoftFever, I'll take a look in those options

JuanR3D avatar Sep 21 '25 08:09 JuanR3D

This issue has had no activity for 90 days, so it will be closed in 14 days.

If it's a bug that still happens on the latest OrcaSlicer release, please leave a comment with the version you tested. If it's a feature request you still want, please leave a comment saying so. Either one keeps it open.

github-actions[bot] avatar Nov 25 '26 01:11 github-actions[bot]