How to position nozzle to the middle of the bed based on bed_shape?
 
Notifications
Clear all

How to position nozzle to the middle of the bed based on bed_shape?  

  RSS
dma_k
(@dma_k)
Eminent Member
How to position nozzle to the middle of the bed based on bed_shape?

Dear all,

Sorry for newbie question. I would like to position the nozzle in the middle of the bed (Y axis) based on bed size in custom printer G-code. I tried this but it didn't work:

G0 Y{rect_size/2}

In settings it displays that the variable name is rect_size but here it is said that none of rect_size, rect_size.y, rect_size.depth works. Just by co-insidence, when I looked at generated G-code, I found this:

bed_shape = 0x0,220x0,220x220,0x220

However here it is said that bed_size can not be used in arithmetic expressions.

Well, how one can do so? Thank you in advance!

Posted : 22/11/2020 6:39 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: How to position nozzle to the middle of the bed based on bed_shape?

which printer?

Prusa is 250mm /210mm

how about 

G1 X125 Y105

Joan

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 22/11/2020 9:41 pm
dma_k
(@dma_k)
Eminent Member
Topic starter answered:
RE: How to position nozzle to the middle of the bed based on bed_shape?

@joantabb

Clear how to set the numbers manually: we all can divide by 2 😉

How to make this value computable?

Posted : 25/11/2020 10:31 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: How to position nozzle to the middle of the bed based on bed_shape?

can you use parse the variables rect_origin and rect_size, instead of  trying to use bed_size

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 26/11/2020 1:38 am
dma_k
(@dma_k)
Eminent Member
Topic starter answered:
RE: How to position nozzle to the middle of the bed based on bed_shape?

@joantabb

I am a complete newbie in PrusaSlicer and got no idea how to parse rect_origin and/or rect_size. Have you got a ready-to-use receipt? I tried to search for anything on this forum, but with no results. I also see that PrusaSlicer does not dump either rect_origin or rect_size in resulting .gcode file, so I don't know what is the value for these variables.

Posted : 26/11/2020 10:46 am
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: How to position nozzle to the middle of the bed based on bed_shape?

@dma_k

rect_origin is usually 0,0 on a cartesian printer, 

rect_size relates the Max X and Max Y values, these are used internally within Prusa Slicer, and are not output to Gcode. 

Prusa slicer must be able to access these values in order to place single items in the dead centre of the build plate, and to indicate when items exceed the build volume of the printer. 

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 26/11/2020 11:27 am
dma_k
(@dma_k)
Eminent Member
Topic starter answered:
RE: How to position nozzle to the middle of the bed based on bed_shape?

I was able to find a solution, but not via slicer. It requires recompilation of Marlin firmware. Define

#define NOZZLE_PARK_POINT { X_CENTER, Y_CENTER, 20 }

and then add

G27 P2

to custom end G-code.

Posted : 09/01/2021 7:29 pm
Share: