Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Z coordinate when come back to purge tower #6773

Open
1 task done
CorvoConV opened this issue Sep 15, 2024 · 10 comments
Open
1 task done

Add Z coordinate when come back to purge tower #6773

CorvoConV opened this issue Sep 15, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@CorvoConV
Copy link

CorvoConV commented Sep 15, 2024

Is there an existing issue for this feature request?

  • I have searched the existing issues

Is your feature request related to a problem?

Good afternoon.
Reviewing the tool change code, after sending, for example, T1, the gcode back to the purge tower does not take into account the Z coordinate. This is a problem because in the tool change macros the head must be maintained at the height of the printing layer and when the head goes to the purge tower it can hit it. I've had this problem with older versions of PrusaSlicer but simply adding the Z coordinate in the gcode back to the purge tower fixed it.
This is an example of what I mean:
ORCASLICER
G1 x200 y150 purge coordinate
G4s0

PRUSASLICER
G1 x200 y150 purge coordinate
G1 z7.25 purge z coordinate
G4s0

Can you improve this please?
Thanks a lot.

Which printers will be beneficial to this feature?

All

Describe the solution you'd like

Just add the layer Z coordinate when come back to purge tower

Describe alternatives you've considered

No response

Additional context

No response

@CorvoConV CorvoConV added the enhancement New feature or request label Sep 15, 2024
@AccelGuide
Copy link

you can specify the name and type of printer,
also a project upload for testing?

@CorvoConV
Copy link
Author

CorvoConV commented Sep 15, 2024

Hi.
The printer its a custom IDEX i build, but the printer does not matter. Its a slicer problem.
In older versions of PrusaSlicer that makes just like now OrcaSlicer, with out the Z coordinate when they come back to the purge tower but in the new version they fix that.
Here is a simple print i do just to calibrate tool offset of my IDEX printer:
image
Its a simple cube that allows me to measure in X and Y with a caliper and know the offset to fix it.
I put real GCODE from both cases for the tool change part in ORCASLICER and in PRUSASLICER.

ORCASLICER:
image

PRUSASLICER:
image

Some times ORCASLICER does not put the Z coordinate when come back to the purge tower.
And other issue its that the first purge in the tower from a new tool its made in the last layer height:
image

I attach both gcode files.
Thanks for your help.
CUBES.zip

@AccelGuide
Copy link

I would like to help, but without the proper .3mf file, I can't be certain. It seems like it's just a filament change G-code issue. Please go to the filament G-code section in PrusaSlicer and copy its content. There will likely be a line like "layer_z" that's missing, which causes the G-code to fail writing it into the final G-code.
orca-slicer_OqW1kvNIWO

Could you please provide the content of the PrusaSlicer filament change G-code, and maybe also the prime tower G-code? Also, try to import a section/line with a semicolon "; Test Z" into Orca Slicer. Can you do that, or am I on the wrong path?

@CorvoConV
Copy link
Author

CorvoConV commented Sep 15, 2024

Hi.
It is for sure a slicer problem. PrusaSlicer fix that in one of the latest updates and they put in the bug fix text as a issue:
image

My layer change gcode its just exact like yours in prusaslicer and orcaslicer. I have the factory gcode configuration for all, layer, tool change, etc. Only make changes on start and end gcode. I try to make changes with the semicolon and diferent gcodes but does not works. Just OrcaSlicer not emit the z position when come back to purge tower. That makes he new tool goes to the wipe tower at layer heigh from parking position and hit the tower some times.
I attach the 3mf file.
Thanks.
CUBE_ORCA.zip

@AccelGuide
Copy link

Thanks for the Info:
Link:
https://github.com/prusa3d/PrusaSlicer/releases?page=2

prusa3d/PrusaSlicer@fa23ab8

So the Solution is to make the same cange like:

Make sure that after wipe tower toolchange the G1 Z is always emitted.

Even if the G1 Z would be redundant, it is still emitted.
Fixes: prusa3d/PrusaSlicer#12361

I will try to get in contackt witch : lukasmatena

@CorvoConV
Copy link
Author

Thanks a lot.
In PrusaSlicer was the solution to my printing problems with my IDEX printer.
This is just the last step to move my IDEX profile to OrcaSlicer ;)

@mattiras
Copy link

mattiras commented Sep 16, 2024

Following, thanks @CorvoConV for reporting. I confirm the behavior. I'm Using 2.2.0 Beta if that matters.

Basically this, flaw I would say, prevents me using OrcaSlicer with tool changer at the moment, so quick fix is most welcome.
Tool change Z lift is a must to "land" nicely back to prime tower. Lift executed either with the slicer or printer firmware/macro, z-height should be restored on prime tower just as it is restored when returning to object being printed.

Additional observation:
Trying to find temporary workaround I found adding:

G91
G0 Z2
G90

to Machine G-code: "Change filament G-code" almost works. But the z height after tool changes is not restored for the last layer.

EDIT:
G1 Z{layer_z+2} F1000 Seems to work as expected, Z-height is restored.

BTW "Change Filament G-code" should be named "Tool Change G-code". Or is the "Change Filament G-code" intended to match "Color Change G-code" as in PS? Anyway, Tool- and color/filament changes are different things, both should be there as in PS.
Change filament is used eg. to manually change filament to tool/MMU loader.

But I like what I have seen so far after a few days of testing, thanks for the developers. Looking forward to start using OrcaSlicer more because PS has lacked tool preheating functionality for years for everyone.
(Prusa XL uses their own command M104.1 which is not supported in Klipper or even possible to enable for custom printer, at least, as far as I know)

Sieppaa
Cross_in_ver2_0.2mm_PLA_Generic Klipper Printer_1h49m.zip

@AccelGuide
Copy link

@lukasmatena Hi,
I Would Like to try my first Change Here on This issue/ Enhancement and would like to question a Code Review, wenn I'm finished?

I have found out that you have made Last time the Change in Prusa Slicer so it Word be Nice if you Could then Help me Check the Code Change and Review, and some Information about "How to" on the Orcas Slicer Projekt.

@igiannakas
Copy link
Contributor

Thanks for the Info: Link: https://github.com/prusa3d/PrusaSlicer/releases?page=2

prusa3d/PrusaSlicer@fa23ab8

So the Solution is to make the same cange like:

Make sure that after wipe tower toolchange the G1 Z is always emitted.

Even if the G1 Z would be redundant, it is still emitted. Fixes: prusa3d/PrusaSlicer#12361

I will try to get in contackt witch : lukasmatena

This feature was already in 2.2 beta. But it causes this issue - last layer nozzle crash when a single filament change happens on the previous layer.
#6894 (comment)

@53Aries
Copy link

53Aries commented Oct 13, 2024

I don't know if this helps you, but here's how I handle Z moves during toolchange.
I use macro Lift_and_Go_to_Purge before the T{next_extruder} command. This causes the toolhead to Z hop the amount specified by {% set z_lift = params.Z_LIFT|default(0)|float %} which is defined in the Change filament G-code section as Lift_and_Go_to_Purge Z_LIFT=1.0. After the toolchange is complete I use macro Move_Back_to_Print which gets it's positions from Change filament G-code section Move_Back_to_Print X={x_after_toolchange} Y={y_after_toolchange} Z={z_after_toolchange}.
The actions look like this: Nozzle moves to prime tower, z hop, toolhead does what it needs to do for toolchange(moving to purge, wiping, etc) Once toolchange is complete the toolhead moves back to the prime tower at the correct Z height to begin printing.

[gcode_macro Lift_and_Go_to_Purge]

params:

Z_LIFT distance to lift the z axis before moving to the purge location

gcode:
{% set z_lift = params.Z_LIFT|default(0)|float %}
{% set z_max = printer.toolhead.axis_maximum.z - printer.gcode_move.homing_origin.z %}
{% set z = printer.gcode_move.gcode_position.z %}
{% set z_park = [z + z_lift, z_max]|min %}

# lift z
G90                     # absolute positioning
G1 Z{z_park}            # move to z position

# move to purge location
Go_To_Purge_Location

[gcode_macro Move_Back_to_Print]

params:

X x position to move to

Y y position to move to

Z z position to move to

gcode:
{% set x = params.X|float %}
{% set y = params.Y|float %}
{% set z = params.Z|float %}
{% set st = printer["gcode_macro TR_Variables"].travel_speed * 60 %}

# move back to print
G90                     # absolute positioning
G1 X{x} Y{y} F{st}      # restore original x and y position
G1 Z{z}                 # restore original z position

{if layer_num >=0}
Lift_and_Go_to_Purge Z_LIFT=1.0
M106 S0
T{next_extruder}
PURGE FV={flush_length} FE={new_filament_e_feedrate}
M106 S0
Wipe_Nozzle
Move_Back_to_Print X={x_after_toolchange} Y={y_after_toolchange} Z={z_after_toolchange}
{endif}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants