Gcode error with dragknife dressup after two complete passes

Hello!

I already opened a topic on the FreeCAD forum but worth also asking here.

I have the attached GCode which I use to cut a 1.2 mm plastic sheet with a drag knife. The program runs 4 time with a 0.3 mm step down after each passes.

During the third pass my machine always fails when doing the second rotation to accommodate the 90° change in direction.

On the figure below the program starts in the middle of the right segment and runs CW

It fails at the bottom left turn on the third pass. See zoomed in image.

Can anyone point me in the right direction to find a solution or workaround?

Terra 182 Base.nc (8.0 KB)

Thanks in advance

1 Like

Define “fails”.

1 Like

The programs stop with ”Gcode error”

So, show us the 10 lines before through the 10 lines after that part of your program…

you mean in the GCode?

1 Like

Yes, it is repeatedly failing in the same exact spot. Your toolchain is producing bad gcode and we need to see that section of code to see what is wrong.

1 Like

I’m about 95% sure the massive G3 commands are doing it. There are 2 on each pass such as:

G3 X60.499 Y190.000 Z0.900 I24257.794 J-696.764 K0.000 F500.000

That “I” value is huge. It’s a tiny piece (but the whole left or right side of the drawing) of a massive arc.

The part that does the handling for the drag knife looks fine.

It seems you may be able to fix this in FreeCAD by enabling “Split Arcs”:

Indeed using the SplitArcs always solves the problem. I had similar issues in the past but failed immediately at the first dragkife turn. I was trying to see why it failed only on the 3rd pass.

I am now testing this PR https://github.com/FreeCAD/FreeCAD/pull/27178

I have looked at the generated code and it looks very similar to having SplitArcs enabled.

Someone on the on teh FreeCAD forum also pointed out that “The errors I saw had very normal I and J values, a few mm.”

here’s the post: https://forum.freecad.org/viewtopic.php?p=872571#p872571

It fails somewhere around here

G0 Z0.900
G3 X-53.195 Y65.191 I0.357 J-3.009
G1 Z0.300
G1 X-54.217 Y65.058 Z0.300 F500.000
G1 X-51.212 Y65.449
G0 Z0.900
G3 X-54.602 Y68.062 I-3.005 J-0.391
G1 Z0.300
G2 X-60.499 Y162.000 I745.228 J93.938
G1 X-60.499 Y190.000 Z0.300 F500.000
G3 X-55.499 Y1740.000 Z0.300 I-24252.794 J853.236 K0.000 F500.000
G1 X-55.499 Y1755.000 Z0.300 F500.000
G2 X-51.075 Y1786.957 Z0.300 I117.632 J0.000 K0.000 F500.000
G2 X-50.215 Y1789.862 I113.208 J-31.957
G0 Z0.900
G2 X-53.991 Y1787.780 I-0.861 J-2.905
G1 Z0.300
G1 X-53.000 Y1787.500 Z0.300 F500.000
G1 X-55.916 Y1788.323
G0 Z0.900
G2 X-52.115 Y1790.407 I2.916 J-0.823
G1 Z0.300

Somewhere around when the Y is higher. Either at the end of the G3 or in the following lines.