Cutter Compensation

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Cutter Compensation

Post by sliptonic »

In a related post, the question of Cutter Radius Compensation (CRC) was raised. I don't use cutter compensation in my home shop so I needed to do some research. While the basics are pretty straight-forward, there seems to be preferences and regional differences in how it's used. Dan Falck did a nice write up on this.

Before we spend much time or energy on this in FreeCAD Path, I thought it would be good to have some discussion about it and get some input about exactly what people would like to see. This would be a good place for non-developers with expertise in CNC and expertise with other CAM software to weigh in.

Some of my questions:

Should the individual operations know anything about compensation? Operations already generate their paths taking tool diameter into account. Should they also take into account the 'use compensation' property and add the appropriate lead-in/lead out and G41 commands?

Alternatively, should the handling of compensation be left to the post processors? In this, the individual operations wouldn't do anything different. The user would select a CRC aware post processor which would modify the final output with the CRC commands. From what I've read, there seems to be variation between machine controllers in how CRC is handled so it makes sense that we would handle CRC commands through the posts.

If the user turns compensation on for an operation but doesn't use a CRC post processor, what should happen? Uncompensated path? Error? Something else?

Is there any reason a compensated path should look different on the screen than an uncompensated path?

I'm sure there are more so I'm very curious how other software packages have handled this issue.

Also, we'll eventually, we'll need a wiki page describing how to use CRC in Path and perhaps some sample post processors. Anyone volunteer to draft them?
ghislainvdwalle
Posts: 17
Joined: Sat Feb 20, 2016 7:19 am
Contact:

Re: Cutter Compensation

Post by ghislainvdwalle »

Hi Sliptonic,

good afternoon,

we have a mill/mold shop in Belgium, having Fanuc, Agie, Charmilles, Haas, Heidenhain and LinuxCNC controls.
The LinuxCNC controls are on one big Iron VMC , the other on a Plasma/Oxyfuel Table.

We have been playing around with the Path Workbench.

For the operator of a cnc machine it works like this:

#1.Out of "a post processor" he is getting his raw G-Code.
Almost always, he will have to make some changes in a plain text editor.
The LinuxCNC post of the Path Workbench does not know the specific conditions of this particular machine.
f.e. for our cutter we use as torch height control (THC):
-for oxyfuel a capacitive height control
-for plasma we use G38 Straight Probe
LinuxCNC does not know this and has to find in the G-Code the appropriate commands.

#2.The operator will always want to visualise the path the tool is going.
There are various Simulators on the market like CnCSimulator or CAMotics.
The one is even worser than the other.
I do not know one commercial control that has good graphics.

We control ALL our paths before considering to put them into the machine with LinuxCNC.
The reason for it is the GUI of Axis; It gives you a detail with outer measurements of the tool path related to the XYZ-axis.
After this control being done, we adapt the G-Code for the specific machine.

Sound advice:
----------------
#1.In the path workbench one actually sees the path changes when changing the tool.
It would help tremendously to have somesort of control of the path outer measurements in X Y Z.
We love therefore the LinuxCNC GUI; please have a look at it.

#2.We only program G41-G42 when necessary. Why?
Leadins and Leadouts are following a set of rules which are different for every control.
We almost always use center paths in the G-Code.
Do NOT use G41-G42 in the post processor!
I would help the operator to get in the post processor G-code having a comment at the beginning and the end of the compensated path like for LinuxCNC:
(Cutter Compensated Path End Mill 10mm)
G0 X100.0 Y50.0
...
...
G0 Z100.0
(End Cutter Compensated Path End Mill 10mm)

Working this way, the operator will know he cannot use this pgm for a 12mm Mill; plain and simple.

I have been looking at the linuxcnc_post.py and the linuxcnc_post.pyc under PathScripts.
I am having no knowledge about Python, but can program Javascript and Liberty Basic (a clone).
In Basic there is a debugger, going line by line to check what's happening.
Is there something similar in Python?
I'd love to have for first post processors for my Wire EDM machines; Agie and Charmilles.
Can you give me some advice about this; cutting a long way short, rather than having to do a quest?

kind regards,

Ghislain :P
ghislainvdwalle
Posts: 17
Joined: Sat Feb 20, 2016 7:19 am
Contact:

Re: Cutter Compensation

Post by ghislainvdwalle »

Hi Sliptonic (again),

Just read Mark Falck's write up, and it confirms our vision:
Using G41-G42 in the G-code is A-OK when knowing at heart your specific machine.
Different controls need different leadins & leadouts.

kind regards,

Ghislain
herbk
Veteran
Posts: 2661
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Cutter Compensation

Post by herbk »

Hi sliptonic,
In the meantime, can you get what you want by defining a tool with a diameter of 0?
yes i did, but i had to make some changes. That's the Objekt:
test5.jpg
test5.jpg (19 KiB) Viewed 4607 times
Thats the gCode freecad produces with no toolsetings:

Code: Select all

(Exported by FreeCAD)
(Post Processor: PathScripts.linuxcnc_post)
(Output Time:2016-04-03 12:17:11.814152)
(begin preamble)
G17 G90
G21
(begin operation: Project)
(compound: Project)
(Path: Machine_)
G0 X0.0000 Y0.0000 Z0.0000
(Path: Profile)
()
G0 X120.0009 Y70.0004
G1 X120.0009 Y70.0004 Z3.0000 F0.00
G1 X105.3563 Y105.3557 Z3.0000 F0.00
G3 X105.3557 Y105.3563 Z3.0000 I-0.0009 J-0.0004 F0.00
G1 X70.0004 Y120.0009 Z3.0000 F0.00
G3 X69.9996 Y120.0009 Z3.0000 I-0.0004 J-0.0009 F0.00
G1 X34.6443 Y105.3563 Z3.0000 F0.00
G3 X34.6437 Y105.3557 Z3.0000 I0.0004 J-0.0009 F0.00
G1 X19.9991 Y70.0004 Z3.0000 F0.00
G3 X19.9991 Y69.9996 Z3.0000 I0.0009 J-0.0004 F0.00
G1 X34.6437 Y34.6443 Z3.0000 F0.00
G3 X34.6443 Y34.6437 Z3.0000 I0.0009 J0.0004 F0.00
G1 X69.9996 Y19.9991 Z3.0000 F0.00
G3 X70.0004 Y19.9991 Z3.0000 I0.0004 J0.0009 F0.00
G1 X105.3557 Y34.6437 Z3.0000 F0.00
G3 X105.3563 Y34.6443 Z3.0000 I-0.0004 J0.0009 F0.00
G1 X120.0009 Y69.9996 Z3.0000 F0.00
G3 X120.0009 Y70.0004 Z3.0000 I-0.0009 J0.0004 F0.00
.......
........
.......
G0 Z9.0000
(finish operation: Project)
(begin postamble)
M05
G00 X-1.0 Y1.0
G17 G90
M2
and with this chanches the part is as draw it

Code: Select all

(Exported by FreeCAD)
(Post Processor: PathScripts.linuxcnc_post)
(Output Time:2016-04-03 13:40:55.893152)
(begin preamble)
G40
G17 G90
G21
T1 M6
(begin operation: Project)
(compound: Project)
(Path: Machine_)
G0 X0.0000 Y0.0000 Z0.0000
(Path: Profile)
()
G0 Z5.0000
G42
G0 X120.0009 Y70.0004
G1 X120.0009 Y70.0004 Z3.0000 F100.00
G1 X105.3563 Y105.3557 Z3.0000 F250.00
G1 X70.0004 Y120.0009 Z3.0000 F250.00
G1 X34.6443 Y105.3563 Z3.0000 F250.00
G1 X19.9991 Y70.0004 Z3.0000 F250.00
G1 X34.6437 Y34.6443 Z3.0000 F250.00
G1 X69.9996 Y19.9991 Z3.0000 F250.00
G1 X105.3557 Y34.6437 Z3.0000 F250.00
G1 X120.0009 Y69.9996 Z3.0000 F250.00
...............
...............
...............
G0 Z9.0000
(finish operation: Project)
(begin postamble)
M05
G40
G0 x0.0000 Y0.0000 Z160.0000
G17 G90
M2
In my mind the Code with CRC, like FreeCad it makes if a tool is set, is very good for all user with a own mill and iff they are using the same tool most time. - and (thats my mind to ;) ) in this time, that will be the biggest count of FreeCad users. ;)

Maybe it is posible to give a choice for using CRC by FreeCad or not.
And i like Ghislain's suggestion for a comment line like "(Cutter Compensated Path End Mill 10mm)".
Last edited by herbk on Wed Apr 27, 2016 3:20 pm, edited 1 time in total.
Gruß Herbert
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Cutter Compensation

Post by sliptonic »

herbk wrote:
In my mind the Code with CRC, like FreeCad it makes if a tool is set, is very good for all user with a own mill and iff they are using the same tool most time. - and (thats my mind to ;) ) in this time, that will be the biggest count of FreeCad users. ;)

Maybe it is posible to give a choice for using CRC by FreeCad or not.
And i like Ghislain's suggestion for a comment line like "(Cutter Compensated Path End Mill 10mm)".
I think all this can be done quite easily by customizing your post processor. The posts are just python code and pretty easy to change. Copy the linuxcnc_post.py file from /Mod/Path/PathScripts to your macro directory. Give it a new name and edit it to suite. Just make sure the new name ends in _post.py.


Ghislain,

If you want to show the machine extents, you can do this now. Set the Machine limits in the Data properties (or edit the corner min/max values in your post processor) and turn on the display of machine limits in the view properties of the machine.

The extents aren't completely shown below because I think my clipping plane is messed up but you get the idea.
Selection_003.png
Selection_003.png (11.8 KiB) Viewed 4593 times
ghislainvdwalle
Posts: 17
Joined: Sat Feb 20, 2016 7:19 am
Contact:

Re: Cutter Compensation

Post by ghislainvdwalle »

Hi Sliptonic,

good morning,

what I meant is that the LinuxCNC gives the outer measurements of the traced path, not only the max & mins of the machine.

http://www.vdwalle.com/LinuxCNC/Schermafdruk.png

kind regards,


ghislain :P
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Cutter Compensation

Post by sliptonic »

ghislainvdwalle wrote: what I meant is that the LinuxCNC gives the outer measurements of the traced path, not only the max & mins of the machine.

ghislain :P
Ahh. I understand. It should be possible to add this but it won't happen for a while. Please add a feature request to the tracker.
Post Reply