Live tool wear compensation

More
23 Jul 2011 09:21 #11761 by grandixximo
I had a small talk on IRC about this.

I would like to post it here to see if it is possible and what's the best approach.

I'll explain briefly:

Normal polishing tools for stone glass ecc... waste a lot, something like 0,12mm every meter on the diameter, now if you want to polish a piece you need to always be touching the surface that you want to polish, here comes the problematic part, i don't have anything right now on EMC2 that can allow me to change the tool diameter while the machine is working a Gcode, but actually the tool diameter is changing, so after a few CM of work i will not be polishing no more.

I would really like a live tool compensation, i think it will be useful to many.

I have been referenced to this wiki.linuxcnc.org/emcinfo.pl?Torch_Height_Control

but i don't think it will work since the torch control actually override and take complete control over the Z axis so it would not follow any Gcode inputted on the Z, but instead i need to follow the Gcode trajectory i just have to slightly modify it while working.

Can i force EMC2 to read the tool diameter while working, and changing the G41-G42 according?

What is the best way to approach this, i'm not scared of changing HAL file or the source code itself, i would just like to know what's the easiest way if there is one...

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

More
23 Jul 2011 11:16 #11762 by cncbasher
yes i agree this would be a good addition , usefull for shaft grinding on a lathe as well as polishing
so i can see a use for it also .

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

More
23 Jul 2011 12:24 #11764 by BigJohnT
If you know the rate of wear and it is constant just adjust your path with your cam program to account for the changing diameter.

John

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

More
23 Jul 2011 16:40 - 23 Jul 2011 16:48 #11770 by grandixximo
What you propose it's too time consuming, for every line and arc you would have to calculate manually the change of trajectory and then draw it, you would probably do a lot of mistakes manually unless you were really practical with CAM, this is effective in my opinion if you want to make a test or run it one time, but actually working this way no, i can take a grinder and do it by hand, it's faster then going crazy trying to program the machine...

But if i could implement in some way a live tool wear compensation, to increment the trajectory would be just a click away, or just a tool parameter away, that's much easier to use, and i think EMC2 needs this implementation, in the market this is a very strong point on advanced CNC contollers.
Last edit: 23 Jul 2011 16:48 by grandixximo.

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

More
25 Jul 2011 15:39 #11832 by andypugh
grandixximo wrote:

but i don't think it will work since the torch control actually override and take complete control over the Z axis so it would not follow any Gcode inputted on the Z, but instead i need to follow the Gcode trajectory i just have to slightly modify it while working..


Part of the solution mught be to use the HAL "offset" component:
www.linuxcnc.org/docview/html/man/man9/offset.9.html
You could put that in the path between axis.n.pos-cmd and stepgen.n.pos-cmd (or the equivalent in your system).
How do you propose to measure the tool diameter?

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

More
27 Jul 2011 02:22 #11901 by grandixximo
The tool have a wear ratio of 0,12-0,13mm every meter, i would like to have this value as a tool setting, and then have also 2 buttons on the interface that i could press to increase and decrease the offset if needed to...

How do you think i should get the diameter, can i know how far the machine has move in G1, and having the diameter go smaller as the machine moves?

I also have to know on which side the tool is working to have the offset in the right direction, otherwise this would only work on a straight lines, and i would have offset in the wrong way if i had to do an outside job instead of an inner one, i know that there is no live tool touching direction information, so where would i take this info...

Do i really have no way of changing the diameter of the tools while working, and force EMC2 to read the changes and act accordingly??

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

More
27 Jul 2011 09:16 #11910 by andypugh
grandixximo wrote:

The tool have a wear ratio of 0,12-0,13mm every meter, i would like to have this value as a tool setting, and then have also 2 buttons on the interface that i could press to increase and decrease the offset if needed to...

The two buttons on the interface to increase/decrease the offset are easy, using GladeVCP and the "offset" component that I mentioned earlier.

How do you think i should get the diameter, can i know how far the machine has move in G1, and having the diameter go smaller as the machine moves?

I am not sure how well that would work, I would imagine tool wear would be a strong function of depth of cut and material type.
Perhaps you could use a laser distance gauge to measure tool diameter?

Do i really have no way of changing the diameter of the tools while working, and force EMC2 to read the changes and act accordingly??

No, because to a large extent all the path calculations are done ahead of time using the tool diameter loaded at tool-load time. The trajectory planner uses a lot of look-ahead to blend the moves, many programs are fully worked-out before the tool hits the work, so there is no way to alter the tool offset then.

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

More
27 Jul 2011 12:00 - 27 Jul 2011 12:01 #11917 by grandixximo
The two buttons on the interface to increase/decrease the offset are easy, using GladeVCP and the "offset" component that I mentioned earlier.

Are you absolutely sure when you say this?

I don't think the offset would work unless it's a dynamic offset, think of a tool that polish a square hole with 4 fillets, depending on what side of the hole the tool is working the offset has to be in the direction where the tool is in contact with the piece to polish, and this side is different for each side of the hole, and it changes side while working the fillets, so the offset when working with the front for example have to be in Y+ while when working on the back it would be in Y-, same with X for left and right.

How can i with a simple 0,1 offset in one direction obtain this result?
Last edit: 27 Jul 2011 12:01 by grandixximo.

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

More
27 Jul 2011 12:56 #11919 by andypugh
Ah, I see.

For some reason I was visualising a cylindrical grinding machine, and all my ideas made sense in that context.

You might be able to do something in a pre-processor. If you inserted a G10 L1 in the code after each G1, based on the length of the preceeding move then the new diameter would be available to the trajectory planner when needed (interpret-time rather than run-time), and the path would be compensated according to normal G41 rules
www.linuxcnc.org/docview/html/gcode_tool...-Radius-Compensation

Once the path is calculated then the next place to intervene is in the kinematics module. It is possible to calculate the tangent to the current path (though not very nicely) inside the kinematics, and then offset the joint position commands accordingly at run-time.
I have made a custom kinematics which uses a similar approach to perform automatic kerf-angle correction on a 5-axis waterjet. Your situation is much simpler.

Your kinematics file would need to export two pins, one for diameter and one for left/right compensation choice. You could then write a custom realtime component that integrates path length (probably using the motion.distance-to-go pin,) and outputs a tool-wear estimate. It could also take button input for manual tweaking. That would be written in comp, and look something like
component wearcomp;
pin in float initial-dia;
pin in float distance-to-go;
pin in float wear-ratio "mm per m or thou per inch";
pin in bit inc-dia;
pin in bit dec-dia;

pin out float current-dia;

variable float last_dtg;
variable float dist_tot = 0;
function _;

;;

FUNCTION(_){
    static int inc_debounce, dec_debounce;
    if (last_dtg > distance_to_go){
        dist_tot= (last_dtg - distance_to_go);
    }
    last_dtg = distance_to_go;
    current_dia = initial_dia - (dit_tot * wear_ratio / 1000.0);
    if (inc_dia == 1 && inc_dia != inc_debounce){
        initial_dia += 0.05;
    }
    if (dec_dia == 1 && dec_dia != dec_debounce){
        initial_dia -= 0.05;
    }
    inc_debounce = inc_dia;
    dec_debounce = dec_dia;
}
(Totally untested, not even written on an emc2 machine, purely as an example of how writing HAL components isn't all that hard)

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

More
28 Jul 2011 01:05 #11938 by grandixximo
I can write function in C++ in the HAL file?

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

Time to create page: 0.095 seconds
Powered by Kunena Forum