Moving the print bed to its maximum height after printing
 
Notifiche
Cancella tutti

Moving the print bed to its maximum height after printing  

  RSS
AvariCe
(@avarice)
Trusted Member
Moving the print bed to its maximum height after printing

Hello all,

I want the printer to move the bed to its maximum height.

If I understand correctly, I will have to change this command from the end code

{if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+23, max_print_height)} F300 ; Move print head up{endif}

To this

G1 Z270 F100

 

Am I right? I haven't tested it since it could damage the printer if I get the command completely wrong.

Best Answer by chmax:

why not use the right variable then?

G1 Z{max_print_height} F300 ; Move bed down to bottom...

Postato : 12/09/2025 12:25 pm
chmax
(@chmax)
Estimable Member
RE: Moving the print bed to its maximum height after printing

why not use the right variable then?

G1 Z{max_print_height} F300 ; Move bed down to bottom...

Postato : 12/09/2025 4:25 pm
1 persone hanno apprezzato
AvariCe
(@avarice)
Trusted Member
Topic starter answered:
RE: Moving the print bed to its maximum height after printing

Thanks!

Postato : 12/09/2025 9:00 pm
Alienbliep
(@alienbliep)
Eminent Member
RE: Moving the print bed to its maximum height after printing

I have try to find this too.
But when the core one starts a new print it lowers the bed agressivly a one or two cm's.
So when you print after an print it collapses Z on the bottom.

That's why i reversed back to stock g-code.
I also find that the core one forgets it's postion. Sometimes in the middle is 0mm. This is no problem because it check for 0mm before each print but maybe this has something to do with it?

a guy on reddit wrote this code: I really don't understand the second sentence.
; This will move the bed to 40mm above max z,
; or 40mm below the max height of the print, or max z
{if layer_z < max_print_height}G1 Z{z_offset+min(max(max_print_height-40, max_layer_z+40), max_print_height)} F720 ; Move print bed down{endif}

Postato : 13/09/2025 2:45 pm
AvariCe
(@avarice)
Trusted Member
Topic starter answered:
RE: Moving the print bed to its maximum height after printing

 

Posted by: @alienbliep

I have try to find this too.
But when the core one starts a new print it lowers the bed agressivly a one or two cm's.
So when you print after an print it collapses Z on the bottom.

That's why i reversed back to stock g-code.
I also find that the core one forgets it's postion. Sometimes in the middle is 0mm. This is no problem because it check for 0mm before each print but maybe this has something to do with it?

a guy on reddit wrote this code: I really don't understand the second sentence.
; This will move the bed to 40mm above max z,
; or 40mm below the max height of the print, or max z
{if layer_z < max_print_height}G1 Z{z_offset+min(max(max_print_height-40, max_layer_z+40), max_print_height)} F720 ; Move print bed down{endif}

I haven't noticed any collapsing yet using chmax's solution.
However, I did a couple of tests trying to cause the Z axis to collapse. 
It didn't collapse after starting another print. Same for cutting the power off and then turning it on again. 

In both cases though, it went the extra 5 mm that it can go. 
The only scenario I couldn't test was tripping a red screen during printng, and I can't reproduce one. 

Postato : 13/09/2025 6:45 pm
Alienbliep
(@alienbliep)
Eminent Member
RE:

I had it set to Z=274 or 275 mm i think. And that is flat on the bottom.

Anyway i tried this code mentioned here in the beginning:

G1 Z{max_print_height} F300

M140 S0 ; turn off heatbed

M141 S0 ; disable chamber control

M107 ; turn off fan

G1 X242 Y211 F10200 ; park{if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move bed down{endif}

M702 ; unload the current filament

M104 S0 ; turn off temperature

G4 ; wait

M572 S0 ; reset PA

M84 X Y E ; disable motors;

max_layer_z = [max_layer_z]

 

This would make the bed park at the bottom, then go back up to unload filament and then go back down half way.... and stop there.

 

 

 

I am now using this with an MMU: (excluded the mmu line in the middle: {if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move bed down{endif}

But still at the very end after the unload filament job is done and the bed is already down it goes back up 1cm and then again down 1cm. Really strange when your already picking something from the bed....

 

{if layer_z < max_print_height}G1 Z{z_offset+min(max(max_print_height-20, max_layer_z+20), max_print_height)} F720 ; Move print bed down{endif}

M140 S0 ; turn off heatbed

M141 S0 ; disable chamber control

M107 ; turn off fan

G1 X242 Y211 F10200 ; park

M702 ; unload the current filament

M104 S0 ; turn off temperatureG4 ; wait

M572 S0 ; reset PA

M84 X Y E ; disable motors

 

 

Stock mmu: 

{if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+1, max_print_height)} F720 ; Move print head up{endif}

M140 S0 ; turn off heatbedM141 S0 ; disable chamber control

M107 ; turn off fanG1 X242 Y211 F10200 ; park

{if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move bed down{endif}

M702 ; unload the current filament

M104 S0 ; turn off temperature

G4 ; wait

M572 S0 ; reset PA

M84 X Y E ; disable motors

; max_layer_z = [max_layer_z]

 

Anyway i don't have any idea why the beginning line is so complicated. I don't understand what this means:

{if layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+1, max_print_height)} F720 ; Move print head up{endif}

Questo post è stato modificato 1 day fa 3 tempo da Alienbliep
Postato : 13/09/2025 7:12 pm
AvariCe
(@avarice)
Trusted Member
Topic starter answered:
RE:

Assuming I understand that correctly, the following happens with that line:

it checks whether the z layer is less than the max print height. Then it tells to move it vertically an amount that is calculated as follows:

z_offset (which is a constant var) + the smaller of the two: the maximum height of the print +1 or the max print height (which is 270). 

After the calculation, it goes to the corresponding height at 270 mm/s

Questo post è stato modificato 1 day fa da AvariCe
Postato : 13/09/2025 7:39 pm
Condividi: