Page 1 of 1

Any way to get min/max coords of a print into a script?

Posted: Sun Jun 09, 2019 10:48 pm
by Zakm0n
So, my goal here is to set up my mesh leveling to cater to every print. I'm using a duet wifi, and there is a g-code to set the probing area for my mesh leveling. If I could set that code in my start script to essentially make a bounding box around my print and put those coordinates into that code, my printer could probe only the necessary area before a print, saving a ton of startup time.

M557 X10:295 Y10:295 S20 is the default setting, that's what is probed by default.

M557 X[AAA]:[BBB] Y[CCC]:[DDD] S20 is what I want where:

AAA is (Xmin) - 10
BBB is (Xmax) + 10
CCC is (Ymin) - 10
DDD is (Ymax) + 10

Anyone have any ideas on how to accomplish this?

Re: Any way to get min/max coords of a print into a script?

Posted: Mon Jun 10, 2019 9:18 am
by bobstro
I wrote a crude python script to parse the gcode and simply track the minimum and maximum X & Y moves. It works well enough.

However, are those few seconds of bed leveling really going to gain you that much time on a multi-hour print? I was worried about "startup time" until I started doing prints that routinely run for 4-12 hours. Much better to get all the calibration and tuning right by spending a few minutes up front than deal with problems later.