I want to switch to Prusaslicer, but have some issues with end gcode.
 
Notifications
Clear all

I want to switch to Prusaslicer, but have some issues with end gcode.  

  RSS
Elothan
(@elothan)
Active Member
I want to switch to Prusaslicer, but have some issues with end gcode.

(I do not use a Prusa printer currently, using a Creality CR-10s Pro V2)

I am looking at all the new fancy features Prusaslicer has got lately, and I am considering a swap from Cura, both due to those and the god-awful UI Cura have for some things.

I have tried PS sporadically, but always find myself going back to the familiar setup, but this time I really want to make an real effort to actually give it a proper chance, but there is one thing I absolutely want to fix, and that's how the slicer handles when a print is finished.

I am no gcode wizzard, but in Cura when it finishes, it just raises Z a bit and moves the bed forward, while prusa lifts Z quite a lot (at first I was worried it would go all the way up and smash into the gantry (it don't). I just wondered if there is a way to get prusaslicer to act the same way as my Cura currently does? Gcode included, I tried just copying and pasting it to PS, but got error messages. so if anyone could give me some advise it would be greatly appreciated as I am blank when it comes to writing gcode.

Cura end gcode

G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positioning

G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed

M84 X Y E ;Disable all steppers but Z
Opublikowany : 11/01/2024 12:19 pm
Neophyl
(@neophyl)
Illustrious Member
RE: I want to switch to Prusaslicer, but have some issues with end gcode.

Yes easily.  You can make it move anywhere you want with the right end gcode block.

The error message you are getting is because yours contains a Cura specific placeholder that PS does not understand.  The {machine_depth}.  For Cura that looks like it equates to whatever you have configured for the bed Y size.  Might even be called Machine depth in Cura.

The list of Prusa Slicer specific placeholder is here https://help.prusa3d.com/article/list-of-placeholders_205643

Also hovering over individual settings in the gui profiles will usually display the variable if there is one.

You can do a couple of things, instead of the placeholder you can use a fixed value based on your bed size.  I used to have a cr10S iirc the bed size was 300x300.  So you could use
G1 X0 Y300 ;Present print

I used to have G1 X0 Y295 F1000 ; move finished print out front.  Which moved it so it was almost all the way forward.

I notice that the profile for the Cr10 V3 uses the following line
G1 X5 Y{print_bed_max[1]*0.85} F{travel_speed*60} ; present print
In effect that moves it forward to 85% of the print bed max size at travel speed  times 60 (probably because one setting is in seconds and the other is in minutes).

 

 

 

Opublikowany : 11/01/2024 12:37 pm
Elothan polubić
Elothan
(@elothan)
Active Member
Topic starter answered:
RE: I want to switch to Prusaslicer, but have some issues with end gcode.

If I am understanding you correct, something like the following should work? (Sorry for needing it spoon-fed) :

Code

G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positioning

G1 X0 Y295 F1000 ; move finished print out front.
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed

M84 X Y E ;Disable all steppers but Z
Opublikowany : 11/01/2024 12:51 pm
Neophyl
(@neophyl)
Illustrious Member
RE: I want to switch to Prusaslicer, but have some issues with end gcode.

Yes, that should work fine.  At least to move the print out front at the end and present it.

Personally I wince a bit on the cura first bit that raises the height by 10mm (the G1 Z10 bit).  The problem with that bit is if you were printing something close to the max height your printer was capable of then it would move up 10mm regardless and you will get a z motor shudder as it tries to drive your x axis up to where it cant go.
But if don't ever print tall stuff then its not going to be a problem for you.

But this is safer -

G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out


G90 ;Absolute positioning
{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+10, max_print_height)}{endif} ; Move print head up 10 mm or as much as the printers maximum hight allows

G1 X0 Y295 F1000 ; move finished print out front.
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed

M84 X Y E ;Disable all steppers but Z
Opublikowany : 11/01/2024 1:26 pm
Elothan
(@elothan)
Active Member
Topic starter answered:
RE:

Not super worried about the height issue, as I have configured my setup in the slicer to have about 5 cm lower Z height than it actually have, (to avoid crashing into my light setup with the direct drive mod, and I have at least a safety margin of 2 cm included in that. I generally never print tall anyway, the only reason I have a larger printer is for the bed size, not height.

The first short print with the gcode is on the printer now, so hopefully it works out like it should in about 10 minutes or so. 🙂 Will test yours after.

 

And thanks a lot for the help!

This post was modified 11 months temu by Elothan
Opublikowany : 11/01/2024 1:33 pm
Elothan
(@elothan)
Active Member
Topic starter answered:
RE:

Tried your code and it worked flawlessly, thanks 🙂  only thing I changed was upping the speed for the presenting bed a bit, and now everything is as it should be! Thanks again!

 

This post was modified 11 months temu by Elothan
Opublikowany : 11/01/2024 2:35 pm
Neophyl polubić
Share: