I thin there might be an issue with cutter compensation. G42

81 views
Skip to first unread message

Azox

unread,
Feb 18, 2018, 3:19:18 PM2/18/18
to dxf2gcode-dev
Hello,

I think there is an issue with the generation of the GCODE for G42.  I effectively want to cut a bunch of ovals with my router table.  I have a dxf of the ovals and I set my cutter compensation to cut on the inside of the line for each oval.  The generated gcode does cut the ovals and from the inside, however it performs the cutter compensation of (G42) when my router is retracted at my Z Retraction level of .5 inches vs cutting the wood at -.250 inches.  So basically the cutter compensation is happening in the air above where I wanted to cut.  I don't know if this is something with how I have the dxf2gcode setup or if it's bug in the code.


Here is a snippet of the generated code to explain. 

*Notice the code produced does a G0 Z .500 and then you will later see the G42 command, but the Z axis doesn't go down until after the cutting compensation is complete.


G20 (Units in inches)
G90 (Absolute programming)
G64 (Default cutting) G17 (XY plane) G40 (Cancel radius comp.) G49 (Cancel length comp.)
G0 Z   0.500

(*** LAYER: 0 ***)
T1 M6
S6000

(* SHAPE Nr: 0 *)
G0 X  22.935 Y   3.305
M3 M8
G42
F15
G1 X  22.995 Y   3.245
G2 X  22.875 Y   3.125 I  -0.120 J   0.000
G0 Z   0.000
F5
G1 Z  -0.250
F15
G2 X  22.875 Y   3.375 I   0.000 J   0.125
G1 X  26.625 Y   3.375
G2 X  26.625 Y   3.125 I   0.000 J  -0.125
G1 X  22.875 Y   3.125
F5
G1 Z   0.000
G0 Z   0.500
G40
M9 M5



I thought the GO Z -.250 command would have occurred right before the G42 command.


Sorry if I am not explaining the problem right, I am still getting used to reading the GCODE and using this tool.

Thanks for any help you can provide.

Scott




Azox

unread,
Feb 18, 2018, 3:42:46 PM2/18/18
to dxf2gcode-dev
Looking more at the GCODE I was expecting it to look like this instead.  (Not the Z axis movement occurring before th G42 command.


G20 (Units in inches)
G90 (Absolute programming)
G64 (Default cutting) G17 (XY plane) G40 (Cancel radius comp.) G49 (Cancel length comp.)
G0 Z   0.500

(*** LAYER: 0 ***)
T1 M6
S6000

(* SHAPE Nr: 0 *)
G0 X  22.935 Y   3.305
M3 M8
G0 Z   0.000
F5
G1 Z  -0.250
F15
G42
F15
G1 X  22.995 Y   3.245
G2 X  22.875 Y   3.125 I  -0.120 J   0.000
G2 X  22.875 Y   3.375 I   0.000 J   0.125
G1 X  26.625 Y   3.375
G2 X  26.625 Y   3.125 I   0.000 J  -0.125
G1 X  22.875 Y   3.125
F5
G1 Z   0.000
G0 Z   0.500
G40
M9 M5



Christian Kohlöffel

unread,
Feb 18, 2018, 3:56:18 PM2/18/18
to dxf2gc...@googlegroups.com

HI  Azox,

 

please check the Options of the postprocessor. I am very sure there is a Option to be selected to have it in that way (Something like chancel_..._befor_...

 

regards

Christian

--
--
You received this message because you subscribed to the Google
Groups-group "dxf2gcode-dev".
To post a message, send mail to dxf2gc...@googlegroups.com
To unsubscribe, send mail to dxf2gcode-de...@googlegroups.com
See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dxf2gcode-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Sebastian Kuzminsky

unread,
Feb 18, 2018, 4:09:27 PM2/18/18
to dxf2gc...@googlegroups.com, Azox
On 02/18/2018 01:19 PM, Azox wrote:
> Hello,

Hi Scott,


> I think there is an issue with the generation of the GCODE for G42.  I
> effectively want to cut a bunch of ovals with my router table.  I have a
> dxf of the ovals and I set my cutter compensation to cut on the inside
> of the line for each oval.  The generated gcode does cut the ovals and
> from the inside, however it performs the cutter compensation of (G42)
> when my router is retracted at my Z Retraction level of .5 inches vs
> cutting the wood at -.250 inches.  So basically the cutter compensation
> is happening in the air above where I wanted to cut.  I don't know if
> this is something with how I have the dxf2gcode setup or if it's bug in
> the code.

I think the way dxf2gcode does it is how cutter compensation normally works.

G42 is modal, meaning you turn it on and it stays on for all future
motions, until you turn it off (with G40).

Normally you start with cutter compensation disabled (that's the G40 on
the third line you quoted, below), you place the cutter up in the air
where there's nothing to run into, and you turn on cutter compensation
with G42.

The G42 command itself does not cause any motion, but it makes the
*next* programmed motion into what's called a "cutter comp entry move".
Over the course of the cutter comp entry move the cutter transitions
smoothly from having the *center* of the cutter following the programmed
path, to having the *left side* (for G42) of the cutter following the
programmed path (thus having the center of the cutter to the right of
the programmed path). For this reason, it's important that the cutter
comp entry move happens while the tool is in the air, or the cut will be
wrong (or at least confusing) during the transition move: starting
uncompensated and ending compensated.

Then you enter the material (for example how dxf2gcode does it, via a
plunge), you cut what you need, raise the tool, disable cutter comp, and
do a cutter comp exit move to return the tool to "center-point of tool
follows programmed path" behavior.

Details on cutter comp behavior can be found here:

http://linuxcnc.org/docs/devel/html/gcode/tool-compensation.html#sec:cutter-compensation

http://linuxcnc.org/docs/devel/html/gcode/g-code.html#gcode:g41-g42


> G20 (Units in inches)
> G90 (Absolute programming)
> G64 (Default cutting) G17 (XY plane) G40 (Cancel radius comp.) G49
> (Cancel length comp.)
> G0 Z   0.500
>
> (*** LAYER: 0 ***)
> T1 M6
> S6000
>
> (* SHAPE Nr: 0 *)
> G0 X  22.935 Y   3.305
> M3 M8
> G42
> F15
> G1 X  22.995 Y   3.245
> G2 X  22.875 Y   3.125 I  -0.120 J   0.000
> G0 Z   0.000


--
Sebastian Kuzminsky

Scott Weiland

unread,
Feb 18, 2018, 8:32:17 PM2/18/18
to dxf2gc...@googlegroups.com
Thank you !  Thats exactly where it was!   The option is : [] Perform cutter compensation outside the piece  and it was checked.  After unchecking it, it works as expected :)


-Scott

To unsubscribe, send mail to dxf2gcode-dev+unsubscribe@googlegroups.com

See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dxf2gcode-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

 

--
--
You received this message because you subscribed to the Google
Groups-group "dxf2gcode-dev".
To post a message, send mail to dxf2gc...@googlegroups.com
To unsubscribe, send mail to dxf2gcode-dev+unsubscribe@googlegroups.com

See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to a topic in the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dxf2gcode-dev/CpPhBt4JSzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dxf2gcode-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
"Live each day the way you wish to be remembered"  - Anon.
"The way to get started is to quit talking and begin doing. " -Walt Disney


Scott Weiland

unread,
Feb 18, 2018, 8:33:37 PM2/18/18
to dxf2gc...@googlegroups.com
Thank you for this information.  These links are very helpful and help explain more.

-Scott


--
--
You received this message because you subscribed to the Google
Groups-group  "dxf2gcode-dev".
To post a message, send mail to dxf2gc...@googlegroups.com
To unsubscribe, send mail to dxf2gcode-dev+unsubscribe@googlegroups.com
See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to a topic in the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dxf2gcode-dev/CpPhBt4JSzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dxf2gcode-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ok Thierry

unread,
Oct 29, 2021, 11:12:34 AM10/29/21
to dxf2gcode-dev
Hello all, 

We need help to understand one bug. Once in a while, one shape among many other will refuse to process a G41 cut but will accept a G42 cut. See the image bellow. All other similar shapes are correct but this one remains unprocessed. If we apply G42, it works. This means the shape is closed and readable but not as a G41. Anyone has an idea why? 

Cheers,
Thierry

Screenshot 2021-10-29 at 3.56.35 PM.png

To unsubscribe, send mail to dxf2gcode-de...@googlegroups.com

See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to a topic in the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dxf2gcode-dev/CpPhBt4JSzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dxf2gcode-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Christian Kohlöffel

unread,
Oct 29, 2021, 12:21:20 PM10/29/21
to dxf2gc...@googlegroups.com

Hi Thierry,

 

in order to better understand it for all of us and to be able to reproduce it. Can you generate a dxf with the affected shape as an test file and also specify the tool diameter which you are using to try to reproduce it.

Just as a guess à This could be linked to a undercut or other tolerance / drawing issues.

 

However this would help a lot at least to guide you a bit more in the correct direction ….

 

Regards

Christian

You received this message because you are subscribed to the Google Groups "dxf2gcode-dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to dxf2gcode-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dxf2gcode-dev/c76a819c-2643-4189-8fda-06335817cc83n%40googlegroups.com.

image001.png

Ok Thierry

unread,
Nov 1, 2021, 7:53:30 AM11/1/21
to dxf2gcode-dev
Hello, 

Here is the DXF and the Gcode it generated. I hope it is useful. May you need more details. let me know. 

DXF
https://drive.google.com/file/d/1lkBLVRpT3CiIa4HLzWghqfYtf0PntxGS/view?usp=sharing

GCODE
https://drive.google.com/file/d/1QtwXvwO8XbuWJ-RLF_u4ODvttpWANRzI/view?usp=sharing

Also, after looking at the Gcode, I realize that our slice depth now does one cut pass at Z-4mm above the material and one pass at Z-0mm before going into the material (-4mm, -8mm, -12mm... etc.) Any idea what we did wrong? We are using the LayerControl to specify the MillDepth and SliceDepth

Screenshot 2021-11-01 at 14.48.06.png

Best,
Thierry 

Christian Kohlöffel

unread,
Nov 2, 2021, 1:14:22 PM11/2/21
to dxf2gc...@googlegroups.com

Hi Thierry,

 

1.)

this seems to be a known topic while handling dxf files which are not drawn exact or exported with tolerances:

 

I located the failure somewhere around here:

The Algorithm cannot find a intersection of the shapes and therefore thinks he needs to remove everything. (But needed to add a bit more failure reporting to find it …)

DEBUG      core.shapeoffset PairWiseInterferenceDetection 600 :  - Begin = End; Remove all; SPoint: Point(X 1634.147 Y 473.239)

 

What kind of geometry are you using (Polyline, LWPolyline, Spline, segments of lines and arcs, or whatever …), how did you generate the dxf? Try to zoom in your dxf with autocad or similar to check for inaccuracies in that region. I didn’t succeeded in making the algorithm more robust if the intersection cannot be found. Feel free to propose / commonly discuss this topic ….

 

2.)

There was a bug with the mill depths and I thought I fixed it. But maybe did implement another one without testing enough. The bug should be around here:

https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/shape.py#l396

 

max_slice = -abs(self.axis3_slice_depth)

        workpiece_top_Z = abs(self.axis3_start_mill_depth)

        # We want to mill the piece, even for the first pass, so remove one

        # "slice"

        initial_mill_depth = 0.0 - max_slice

 

2 times negative is positive again I guess ….

image001.png
Reply all
Reply to author
Forward
0 new messages