chrissb
Posts: 1
Joined: Fri Nov 27, 2015 7:19 pm

Script Variables for Print Bounds

Hi there,

I've been playing around with automatic bed levelling a lot lately, and I thought it would be handy to be able to adjust the points that are probed to coincide with the size of the printed object - that way, if you're printing a 20mm cube, the printer won't generate a bed levelling solution based at measurements near the edges of the bed.

Obviously for a perfectly flat bed this isn't a problem, and the measurements taken near the edges of the bed would be more accurate than a set of measurements taken right in the centre of the bed. However, with a bed that is uneven, bed levelling using the edges of the bed might not work.

My familiarity is only with the bed levelling implementation in the Marlin firmware, but I imagine what I want to suggest would work with other firmware as well. My current starting script currently looks like this:

Code: Select all

G28 ; home all axes
G29; bed level
By default, G29 uses bounds pre-set in the firmware. However, G29 can also be passed arguments representing the bounds to be levelled, as such:

Code: Select all

G28 ; home all axes
G29 F80 B80 L80 R80; bed level
This would cause the bed levelling routine to take place using measurements taken around the centre of the board, rather than the edges. This means that for small prints that only occupy a fraction of the bed, bed levelling could be more accurate.

Obviously it would be possible to adjust these values by hand for each print, but this should be fairly easy to make automatic. If the script interface had variables to represent the X and Y bounds of the object being printed (or bounds representing the active print area, including brim, skirt, etc), then this process could be automated with something like this:

Code: Select all

G28 ; home all axes
G29 F[y#_min] B[y#_max] L[x#_min] R[x#_max]; bed level
This way, the printer would only probe the section of the bed that is going to be used during printing. This would speed up probing for small parts (insignificant, but a nice bonus) and increase accuracy (important).

These variables seem, to me, to be something that should be easy to add - but then I'm not a programmer, and I could be completely wrong. It's also possible that some way to achieve this functionality is already built into the program, in which case I'd appreciate it if someone could point it out to me.

Regards,
-Chris

Return to “Feature Requests”