Live tool wear compensation
- grandixximo
- Topic Author
- Offline
- Premium Member
- Posts: 132
- Thank you received: 5
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.
so i can see a use for it also .
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
- grandixximo
- Topic Author
- Offline
- Premium Member
- Posts: 132
- Thank you received: 5
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.
Please Log in or Create an account to join the conversation.
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.
- grandixximo
- Topic Author
- Offline
- Premium Member
- Posts: 132
- Thank you received: 5
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.
The two buttons on the interface to increase/decrease the offset are easy, using GladeVCP and the "offset" component that I mentioned earlier.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...
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.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?
Perhaps you could use a laser distance gauge to measure tool diameter?
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.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.
- grandixximo
- Topic Author
- Offline
- Premium Member
- Posts: 132
- Thank you received: 5
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?
Please Log in or Create an account to join the conversation.
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;
}
Please Log in or Create an account to join the conversation.
- grandixximo
- Topic Author
- Offline
- Premium Member
- Posts: 132
- Thank you received: 5
Please Log in or Create an account to join the conversation.