Live tool wear compensation

More
28 Jul 2011 01:28 #11939 by andypugh
grandixximo wrote:

I can write function in C++ in the HAL file?


Well, sort-of. Comp (which is more like C) and in a HAL component.

linuxcnc.org/docs/html/hal_comp.html

Please Log in or Create an account to join the conversation.

More
16 Dec 2013 13:22 - 16 Dec 2013 13:29 #41638 by grandixximo
Sorry to reaply to such an old post, i still have not implemented the live tool wear, but i'm still interested.

I have read your post countless times, i still don't understand some things, you say to program a G10 L1 after every G1, but it's an error to write a G10 L1 while tool compensation on, so there is no recalculation unless i exit compensation and re enter it for each and every move.

Wouldn't it be simpler to have a custom Mcode that set a pin to the wear value (managed with the cam according to the working distance), having this pin change gradually with limit.2, and then send it inside an hal component with the working direction from the kinematics, to calculate X and Y offsets.

Or might be even better having the wear as axis W with acceleration, always managed the same way, if my CAM could send me a calculated wear on each line, this implementation should be simpler right?

The diameter can be set with G10L1 after the compensation is finished, so the next compensated job will start from compensation 0 again.
Last edit: 16 Dec 2013 13:29 by grandixximo.

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 06:08 #41658 by andypugh

I have read your post countless times, i still don't understand some things, you say to program a G10 L1 after every G1, but it's an error to write a G10 L1 while tool compensation on, so there is no recalculation unless i exit compensation and re enter it for each and every move.

I thought that you were trying to compensate something like a cylindrical grinder, where tool length is what needs to be compensated, not tool diameter. I that case I think you could continually update the tool length, though it would interrupt motion blending.

Wouldn't it be simpler to have a custom Mcode that set a pin to the wear value (managed with the cam according to the working distance), having this pin change gradually with limit.2, and then send it inside an hal component with the working direction from the kinematics, to calculate X and Y offsets.

Yes, this would be simpler, and there is actually no need for it to be an M-code. You could use a G-code analogue output into a HAL component.
The HAL component could track X and Y positions and calculate distance of cut, and then output offsets to be applied to the joint positions.

There is no way to do this at a lower level. The G-code is converted into a sequence of linear moves that are added to the motion queue and consumed by the real-time part of the motion system. A long straight move might be calculated once in the first microseconds of runtime, and then the actual move could last hours. Tool offsets are applied before the move gets to the queue and the tool offsets are not looked at again until the system hits a queue-buster such as toolchange (or, in fact, G10)
At least, I _think_ that is how it works, and it is likely to become more, not less, like that in the future.

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 08:36 - 17 Dec 2013 08:37 #41673 by grandixximo
When you say G-code analogue output, i think you mean M68, right?

But with M68 or a custom Mcode M100 -199 like i was thinking would both still break the axis motion, and not having a nice G64 continuos speed on my cotour will ruin the polish.

from the docs
M68 output happen immediately as they are received by the motion controller.
They are not synchronized with movement, and they will break blending.

M100 Execution of the G code file pauses until the external program exits

So i think axis W should be the way to go, it won't brake motion at least, it will be interpolated as axis W.
Last edit: 17 Dec 2013 08:37 by grandixximo.

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 08:43 #41674 by andypugh

When you say G-code analogue output, i think you mean M68, right?


No, M67. That gets inserted into the motion queue and doesn't break blending.
The following user(s) said Thank You: grandixximo

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 08:48 - 17 Dec 2013 08:49 #41675 by grandixximo
Sorry, just woke up, missed that there were 2 analog control codes :lol:

I see it now :P
Last edit: 17 Dec 2013 08:49 by grandixximo.

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 10:25 #41679 by grandixximo
any suggestions on how should i get the direction pin out of the kinematics?

Please Log in or Create an account to join the conversation.

More
17 Dec 2013 17:47 #41688 by andypugh

any suggestions on how should i get the direction pin out of the kinematics?


You could have a look at tangentkins: www.linuxcnc.org/index.php/german/forum/...t-to-path-xy?start=6

I will point out that it doesn't work perfectly. In an ideal world there would be a HAL pin directly driven by the motion planner.
The following user(s) said Thank You: grandixximo

Please Log in or Create an account to join the conversation.

More
18 Dec 2013 10:40 - 18 Dec 2013 12:14 #41735 by grandixximo
I made a custom kinematics, with a pin showing the motion direction, thank you for your help!!

How should i go at creating pins showing G41 or G42, can i do this in kinematics module also?

You wrote i should export this from kinematcs in an old post, but i really don't see how.
Last edit: 18 Dec 2013 12:14 by grandixximo.

Please Log in or Create an account to join the conversation.

More
18 Dec 2013 17:59 #41747 by andypugh

How should i go at creating pins showing G41 or G42, can i do this in kinematics module also?.


I don't think kinematics is the natural place to do that.

In the development branch the current compensation mode is available to G-code as #<_comp> though that might not be any help to you:
www.linuxcnc.org/docs/devel/html/gcode/o....html#sec:parameters

I don't have access to the git repository at the moment, so I can't see the source code to work out if the required HAL pin already exists somewhere, though I think that the natural home for such a pin would be in halui
www.linuxcnc.org/docs/devel/html/man/man1/halui.1.html
The following user(s) said Thank You: grandixximo

Please Log in or Create an account to join the conversation.

Time to create page: 0.205 seconds
Powered by Kunena Forum