SVGToolpathReader icon indicating copy to clipboard operation
SVGToolpathReader copied to clipboard

Raise initial Z Height to prevent drag from edge to where drawing starts

Open shardsofaperture opened this issue 3 years ago • 1 comments

Any SVG written by the program to gcode starts at say X0 Y0 Z0.2 in my case. I have a 500 x 500 bed with a sheet of paper in the middle, it will drop the pen down to the G28 (0,0,.02) and drag that z across the bed until the start of the drawing. Have tried several different ways to make that "z hop" before dropping on the first point but no matter what, even with G28 F3000 Z10, then G0 F3000 Z0.2 it ignores or breaks the plugin. My thought would be the prime should be activating then it should be sloping down to the start point, but I can't figure it out.

   #regular retraction setting in cura 2mm
    #minimum retraction distance in cura cura .5
    #zhop retraction speed in cura 10 mm/same
    #zhop retraction height in cure 2mm
    #changed blob prime to F15000 . . Z10\n in line 372
    #changed z prime position in cura to 1mm  

tried a few lines right around the if retraction_enable lines 374 - 380

Try 1 result += "G0 G10\n" Try 2 result += "G10\n".getProperty("retraction_enable", "value") Try 3 result += "G0 F15000 Z5" Try 4 result += "G28 Z5" Try 5 result += "G28 X0 Y0 Z5" Try 6 result += "G0 Z15\n" Try 7

result += "G10\n".getProperty("retraction_enable", "value")
result += "G0 F15000 Z{layer_height}".format(layer_height=layer_height_0)

I also tried adding a separate variable at the top for layer_height_Z_start but couldn't figure it out either - just something if anyone else wants to take a crack at this was what I tried and didn't succeed with.

shardsofaperture avatar Nov 28 '22 16:11 shardsofaperture

Ok I made some good success with this finally. Not only this but keeping the printer from going out of bounds which I realize is hacky but it is dependent on MY pen holder being mounted to the +xy of my extruder and nozzle with a 300x300 bed.

To fix the z-hop before moving to start position (preventing drag of pen) i changed the G0 values to add +4. This includes the changes from my comment for #8 where I added G10/G11 to enable zhop. Zhop was then turned on in cura and set to 4mm as well.

for layer_nr in range(num_layers):
if not magic_spiralize:
+ gcodes.append("G0 Z4.0{z:.6f}".format(z=layer_heights[layer_nr]))

and here

if retraction_hop_enabled:
+ gcode += " Z4.0{z:.6f}".format(z=layer_heights[layer_nr] + retraction_hop)
gcode += "G10\n" #enable retraction gcode
is_retracted = True
+ gcode += "G0 z4.0"

Then in addition to keep everything IN the bed since gcode goes outside of bed i added a G92 Y-50. This is because my pen holder design is in front my nozzle to the right as looking at it.

gcodes.append("M140 S0") #Cool everything down.
+ gcodes.append("G92 Y-50") #keep nozzle inside printable area
gcodes.append("M104 S0")
gcodes.append("M107") #Fans off.
gcodes.append(machine_end_gcode)

Finally I changed my machine settings to have a bed size of 250 mm x 250 mm (instead of 300mm x 300mm)

shardsofaperture avatar Dec 08 '22 20:12 shardsofaperture