I’m new to gcode and post processors so bare with me, this hatchet job only half worked and I could do with some help to fix it. I ran into the “radius to end of arc differs to radius to start on line #” error in mach 3, from some digging around here I found that the issue was that the xy co-ords were not defined before the cut. I believe this is due to the Laser off command coming after the move to start location similar to this:
N1670 G02 X51.8982 Y173.8706 I74.1210 J-47.8511
N1680 M05 (Laser Off)
N1690 G00 X95.3694 Y187.8662
N1700 M11P1 (Laser On)
N1710 G03 X80.3105 Y172.2989 I51.7976 J-65.1733
N1720 G03 X59.4848 Y178.2507 I-33.3227 J-77.1858
N1730 G02 X95.3694 Y187.8662 I40.2652 J-78.5007
I have made an attempt to fix this by having the post processor insert a command before the arc to define the start position again, with these commands:
function OnArc()
post.ModalText (" G01")
post.NonModalNumber (" X", currentX * scale, “0.0000”)
post.NonModalNumber (" Y", currentY * scale, “0.0000”)
post.Eol()
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.NonModalNumber (" X", endX * scale, “0.0000”)
post.NonModalNumber (" Y", endY * scale, “0.0000”)
post.Text (" I")
post.Number ((arcCentreX - currentX) * scale, “0.0000”)
post.Text (" J")
post.Number ((arcCentreY - currentY) * scale, “0.0000”)
post.ModalNumber (" F", feedRate * scale, “0.0###”)
post.Eol()
end
The 4 bold lines are the new command lines I have added, to some degree this worked, the post would spit out this:
N2180 M05 (Laser Off)
N2190 G00 X140.0152 Y21.2493
N2200 M11P1 (Laser On)
N2210 G01 X140.0152 Y21.2493
N2220 G02 X104.1306 Y11.6338 I-40.2652 J78.5007
N2230 G01 X104.1306 Y11.6338
N2240 G03 X119.1895 Y27.2011 I-51.7976 J65.1733
N2250 G01 X119.1895 Y27.2011
N2260 G03 X140.0152 Y21.2493 I33.3227 J77.1858
N2270 M05 (Laser Off)
N2280 G00 X95.3703 Y11.6338
N2290 M11P1 (Laser On)
N2300 G01 X140.0152 Y21.2493
N2310 G02 X59.4856 Y21.2489 I-40.2652 J78.5007
N2320 G01 X59.4856 Y21.2489
N2330 G03 X80.3107 Y27.2011 I-12.2714 J82.3406
N2340 G01 X80.3107 Y27.2011
N2350 G03 X95.3703 Y11.6338 I67.4513 J50.1835
however it caused 2 problems:
-
the major problem that this command now defines an entirely different start point on the arc usually cutting a straight line to a new point not on the arc or different to the g00 move function. digging through the example above lines N2180 through N2280 define the movement as it should be but the problem seems to be N2300 the inserted g01 defining wrong and using co-ordinates from N2190 and N2210.
-
here is also a minor problem of excess code there is now an additional line for every arc in the path even though this is a closed loop line. this would be nice to clean up but is not really an issue.
If anyone could help me figure out where I’ve gone wrong or steer me back on track that would be much appreciated
if you need any additional info let me know