G43 tool length 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!
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: G43 tool length compensation

Post by chrisb »

blazini36 wrote: Wed Jun 27, 2018 10:19 pm Has this been implemented yet?
It does not seem so, I think that rmu forgot the pull request.
rmu wrote: Thu May 03, 2018 1:01 pm ok, i implemented an option "--tool-length-compensation", see https://github.com/rmu75/FreeCAD/commit ... de4103c6fb
Until it is in master try replacing linux_cnc.py with rmu's file.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Re: G43 tool length compensation

Post by rmu »

chrisb wrote: Thu Jun 28, 2018 6:20 am
blazini36 wrote: Wed Jun 27, 2018 10:19 pm Has this been implemented yet?
It does not seem so, I think that rmu forgot the pull request.
rmu wrote: Thu May 03, 2018 1:01 pm ok, i implemented an option "--tool-length-compensation", see https://github.com/rmu75/FreeCAD/commit ... de4103c6fb
Until it is in master try replacing linux_cnc.py with rmu's file.
It will still take some time to prepare a pull request, I'm quite busy right now, and I ran into some issues regarding unicode that need to be fixed yet. For now putting linuxcnc_post.py from mentioned branch into your local ~/.FreeCAD/Macro directory should let you test it.
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Re: G43 tool length compensation

Post by rmu »

I rebased the branch to current master, if someone wants to take a look at it.
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: G43 tool length compensation

Post by Erich Schulz »

sliptonic wrote: Wed May 02, 2018 9:24 pm
My concern is that new users and users with hobby-class controls will use the linuxcnc post, get TLO, get confused and we'll have an ongoing support issue.
haha ha... bingo!!!

ok I'm confused!

is someone who understands perhaps able to edit this page:

https://www.freecadweb.org/wiki/Path_ToolLenthOffset

simple question really is when would this be set to anything other than 0? and are there any gotchas?

I'd have a crack at that page but I fear I am so woefully ignorant on gcode that I would surely muck it up
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: G43 tool length compensation

Post by sliptonic »

Erich Schulz wrote: Tue Jul 16, 2019 10:21 am
is someone who understands perhaps able to edit this page:

https://www.freecadweb.org/wiki/Path_ToolLenthOffset

simple question really is when would this be set to anything other than 0? and are there any gotchas?

I'd have a crack at that page but I fear I am so woefully ignorant on gcode that I would surely muck it up
G43 is a pretty simple gcode command in concept. Issued with an H-word parameter, it adds that value to the calculated control point. If it has no parameter, it uses the TLO stored in the machine control tool table. Of course this is all done in the machine controller. The Path G43 command itself does almost nothing. It just inserts a G43 command into the path.

How the command is actually interpreted is based on the machine control. LinuxCNC behavior is probably the standard but even LinuxCNC differs slightly from RS-274. LinuxCNC reference is documented here: http://linuxcnc.org/docs/html/gcode/g-c ... #gcode:g43

The Path G43 operation was implemented early in a simple way to allow compensated toolpaths without hand editing. We should probably think about re-implementing support for tool length compensation in a more serious way. For example, enable tool length compensation at the job level and a G43 could be inserted after every tool change and a G49 at the end.

Gotchas? Plenty. This is definitely not an area for newbies to tread into blindly.
  • G43 has to be called after every tool change to apply the offset of the new tool. It isn't modal for the job.
  • Behavior can vary between random and nonrandom toolchangers
  • Some controls will accept negative values for TLO, others won't.
  • Probably more that I'm forgetting
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: G43 tool length compensation

Post by Erich Schulz »

many thanks for that!

what do you think would be the best page to insert those notes into do you think?

https://www.freecadweb.org/wiki/Path_ToolLenthOffset

or

https://www.freecadweb.org/wiki/Path_Workbench

or somewhere else?

so, is the logic something like:

"If you are only using a single tool then you may leave this value at zero. If you are using multiple tools then this setting will allow the g-code to communicate differing tool lengths to mill without re-zeroing the z axis"

??

sorry noob question: it doesn't seem like the tool details are captured in g-code (at least after a linuxcnc post-process). Is the idea that you manually set-up your tool table in both freecad and the CNC to match each other? in which case does the FreeCad TLO do anything? (or does it do something in some post-processors only?? I'm thinking maybe a CNC that doesn't have a tool table??)
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: G43 tool length compensation

Post by sliptonic »

Wait. Back the horse up.

Is this topic even relevant? I think the TLO partial operation is deprecated and not even accessible anymore.

The Tool property stores the length offset value but I don't think it's being used anymore.

Somebody correct me if I'm wrong
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: G43 tool length compensation

Post by mlampert »

sliptonic wrote: Wed Jul 17, 2019 12:33 am The Tool property stores the length offset value but I don't think it's being used anymore.
It's not used AFAIK, it's also broken last time I came across it.
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: G43 tool length compensation

Post by Erich Schulz »

ok so instruction to noobs is "ignore it"?

the ghost of TLO seems to live on in 2 places in UI:
Screenshot from 2019-07-17 12-55-32.png
Screenshot from 2019-07-17 12-55-32.png (92.46 KiB) Viewed 1628 times
and in the job:
Screenshot from 2019-07-17 12-57-52.png
Screenshot from 2019-07-17 12-57-52.png (61.05 KiB) Viewed 1628 times
jkv
Posts: 12
Joined: Wed Feb 28, 2018 10:38 am

Re: G43 tool length compensation

Post by jkv »

I have tried to implement the G43 tool length compensation in a first simple attempt by changing the linuxcnc postprocessor. Three days ago (Sun Jul 14) I published it in my post titled 'Fanuc 15m post and several questions'. As sliptonic has mentioned the G43 must be given after every tool change for the first z move with the syntax G43 Z___ H __ e.g. G43 Z4.356 H27, whereby H is the machine register for the tool with the number 27. So, an arbitrary tool number has to be defined and the first Z move must be isolated. As far as I can see that's all. As I have written in my post isolationg the first move is a problem in FreeCAD. I my opinion the G43 tool length compensation should be handled in the post. What do you think about that?
Post Reply