wirlybird
Posts: 1374
Joined: Sun Jul 17, 2016 1:32 pm

Lower Bed After Print Using Variable?

I'd like to add a variable to the end script that is used in another slicer to lower the bed after a print.

This is the statement in the other slicer - the section in BOLD is the variable that moves the bed lower.
The specific variable is "max_layer_z" I haven't been able to find a corresponding one for S3D.

M17 Z0.4 ; lower z motor current to reduce impact if there is something in the bottom

{if (max_layer_z + 100.0) < 250}
G1 Z{max_layer_z + 100.0} F600
G1 Z{max_layer_z +98.0}
{else}
G1 Z250 F600
G1 Z248
{endif}


M400 P100
M17 R ; restore z current
S3D-Jason
Posts: 1398
Joined: Sun May 31, 2015 6:01 am

Re: Lower Bed After Print Using Variable?

Is max_layer_z supposed to be the highest Z-position of the print? If so, you could use the [build_max_z] variable in S3D.
wirlybird
Posts: 1374
Joined: Sun Jul 17, 2016 1:32 pm

Re: Lower Bed After Print Using Variable?

I think so but let me check on this.

UPDATE:
Ok, here is what I found on a Prusa site. I think this may apply since Bambu Studio is somewhat based on Prusa slicer.

max_layer_z: The maximum height of your sliced print. Note that this is only evaluated a SLICE time, not at PRINT time. This is a value in the slicer that is set to the maximum height of your print in mm.


P.S. First test prints using S3D on the Bambu X1 Carbon did well.
There are a few things in the slicer settings that need to be adjusted. Acceleration and jerk are one. It seems S3D is using the "MAX" values set in Bambu Studio and not the actual values used for slicing.

Also, first layer height and width are a little excessive. Caused some pretty good over extrusion on the first layer!
wirlybird
Posts: 1374
Joined: Sun Jul 17, 2016 1:32 pm

Re: Lower Bed After Print Using Variable?

S3D-Jason wrote: Thu Jan 19, 2023 2:13 pm Is max_layer_z supposed to be the highest Z-position of the print? If so, you could use the [build_max_z] variable in S3D.
Ok, I gave this a try and it did not work. May be how the "IF" statement is constructed.

Here is what I currently have.

{if ([build_max_z] + 100.0) < 250}
G1 Z{[build_max_z] + 100.0} F600
G1 Z{[build_max_z] +98.0}
{else}
G1 Z250 F600
G1 Z248
{endif}
S3D-Jason
Posts: 1398
Joined: Sun May 31, 2015 6:01 am

Re: Lower Bed After Print Using Variable?

I believe the V5 syntax is this:

{IF "[build_max_z] > 250"}G1 Z10

You have to put the conditional in double quotes.
wirlybird
Posts: 1374
Joined: Sun Jul 17, 2016 1:32 pm

Re: Lower Bed After Print Using Variable?

S3D-Jason wrote: Mon Jan 23, 2023 5:41 pm I believe the V5 syntax is this:

{IF "[build_max_z] > 250"}G1 Z10

You have to put the conditional in double quotes.
Didn't work.

Return to “General Discussion and Tips”