Adaptive mesh probing script for PrusaSlicer & SuperSlicer
-
EDIT: Silly me forgot that arrays are zero indexed, so before we probed a square that was turned 90 degrees to what it should have been.
Hihi.
I made this little snippet to have your printer only probe the bed in the areas where you have your prints.
I have only tested it on SuperSlicer, but the command fully complies with PrusaSlicer documentation.
You insert this script in your "printer settings" section, in the "start g-code" box.
It should go after you have heated the bed, and after G28, and G32.
This replaces your normal G29 command.;--- Start adaptive mesh probing M557 X{first_layer_print_min[0]}:{first_layer_print_max[0]} Y{first_layer_print_min[1]}:{first_layer_print_max[1]} S20 ;define probe area with 20mm between each probe spot G29 S0 ;start probe, save and activate height map ;--- Stop adaptive mesh probing
I made this for my V-core3.1.
Here is my full start g-code, in case you need it, or have suggestions for improvements.M115 U3.1.0 ;tell printer latest fw version M83 ; extruder relative mode ; Heat bed before probing so heat expansion of bed is mostly accounted for M140 S[first_layer_bed_temperature] ; set bed temp M190 S[first_layer_bed_temperature] ; wait for bed temp G28 ; home all G32 ; make sure build plate is level. 3 point probe. ;G29 S1 ;load mesh (disabled because of adaptive mesh probing) ;--- Start adaptive mesh probing M557 X{first_layer_print_min[0]}:{first_layer_print_max[0]} Y{first_layer_print_min[1]}:{first_layer_print_max[1]} S20 ;define probe area with 20mm between each probe spot G29 S0 ;start probe, save and activate height map ;--- Stop adaptive mesh probing ; Heating nozzle after probe so we avoid oozing M104 S[first_layer_temperature] ; set extruder temp M109 S[first_layer_temperature] ; wait for extruder temp ;---start adaptive purge line G92 E0.0 ; reset extruder G1 X{first_layer_print_min[0]-10} Y{first_layer_print_min[1]} Z0.8 F6000.0 ; position 10mm left from the lower left of the first layer G1 X{first_layer_print_min[0]-10} Y{first_layer_print_min[1]+30} E6 F360.0 ; extrude some filament in the y direction G92 E0.0 ; reset extruder G1 X{first_layer_print_min[0]-30} Y{first_layer_print_min[1]+15} E6 F360.0 ; extrude some filament in both the x and y direction G92 E0.0 ; reset extruder G1 X{first_layer_print_min[0]-10} Y{first_layer_print_min[1]} E6 F360.0 ; extrude some filament returning back to the start G92 E0.0 ; reset extruder ;---end adaptive purge line
-
undefined droftarts referenced this topic
-
@imonsei thanks for posting this. I will have to give it a go on my toolchanger.
-
@imonsei I forgot to say that when i delay heating the nozzle, it is not suitable for printers that use the nozzle for probing the bed. In this case definitely heat the nozzle before doing probing, so the heat expansion of the metal in the nozzle has had time to happen, and the little plastic at the end of the nozzle doesn't give false Z readings.
-
@imonsei I just thougt of a potential error: if you don't define a probe grid big enough, the printer will be unhappy about this.
I modified my script, so it always takes at least a 60x60 millimeter grid, for a 3x3 probe grid.
I have made checks, if you place your items too far to the end of the build plate, and the probe would go outside the end.
This is posted as a reply because the code here is kind of unreadable unless you take time to break it down.
When my brain is cooperating with me again, I would like to expand the probe area toward Xmin and Ymin if we are close to the max edge of the buildplate. That will have to be another day.;--- Start adaptive mesh probing ; this defines a minimum zise of 60x60 mm grid for probing if your print is too small. if you have placed your print items too near the print bed end, we restrict probe area, so we don't probe outside the print bed. ;TODO: check if we go outside of print bed and expand toward xmin and ymin in stead M557 X{first_layer_print_min[0]}:{min(max(first_layer_print_max[0], first_layer_print_min[0]+60),print_bed_max[0])} Y{first_layer_print_min[1]}:{min(max(first_layer_print_max[1],first_layer_print_min[1]+60),print_bed_max[1])};define probe area with 20mm between each probe spot G29 S0 ;start probe, save and activate height map ;--- Stop adaptive mesh probing
-
Anyone care to look this over for glaring errors?
It does spit out a valid grid for me, and expands toward start of x and/or y if you go beyond bed edge max;--- Start adaptive mesh probing ; this defines a minimum size of 60x60 mm grid for probing if your print is too small, with 20 mm between probes. if you have placed your print items too near the print bed end, we move probe area, so we don't probe outside the print bed. {if first_layer_print_size[0] > 60 and first_layer_print_size[1] > 60 }M557 X{first_layer_print_min[0]}:{first_layer_print_max[0]} Y{first_layer_print_min[1]}:{first_layer_print_max[1]} S20 {else }M557 X{ if first_layer_print_min[0]+60 < print_bed_max[0]}{ first_layer_print_min[0]}:{first_layer_print_min[0]+60}{ else}{ first_layer_print_max[0]-60}:{first_layer_print_max[0]}{ endif} Y{ if first_layer_print_min[1]+60 < print_bed_max[1]}{ first_layer_print_min[1]}:{first_layer_print_min[1]+60}{ else}{ first_layer_print_max[1]-60}:{first_layer_print_max[1]}{ endif}{ endif} G29 S0 ;--- Stop adaptive mesh probing