Page 1 of 3

Z-offset after tool change wrong

PostPosted: Fri Jan 20, 2023 6:04 pm
by CADdy
Hi all,
I would like to come back to my problem with the Z height when changing tools. It happened to me again today that after changing the tool and then measuring the new cutter, the Z height was totally wrong. On the first attempt, the cutter milled about 20 mm above the workpiece. Measuring the same tool again then made it fit. A new change with another tool would have rammed it fully into the workpiece. The emergency stop protected against this.

I found the following message:

Tooloffset-Error.png
Tooloffset-Error.png (18.46 KiB) Viewed 5645 times

Could this be related? How could I set the offset to the current tool? What could be done to fix the error? UCCNC version is 1.2115

Peter

Re: Z-offset after tool change wrong

PostPosted: Fri Jan 20, 2023 6:08 pm
by cncdrive
This is not a "stock" UCCNC message, but the message is likely coming from a macro or from a plugin.
Probably from your tool length macro.
The issue is likely to be in that macro or plugin, so I would check the code in it.

Re: Z-offset after tool change wrong

PostPosted: Fri Jan 20, 2023 10:50 pm
by CADdy
Thank you for your answer. I have the "neon screenset" from laki in use. I did not find the text of the message in any macro or plugin. Would have been too easy.

If I use the original screenset from UCCNC, this error message should not occur anymore? And I hope the indefinable jumps of the Z-position should then also be a thing of the past...

Peter

Re: Z-offset after tool change wrong

PostPosted: Sat Jan 21, 2023 7:01 am
by dezsoe
This message comes from the probing plugin (probe screen). It is what it is: you have a tool loaded and G43 or G44 is set to another tool. E.g.: M6 T1, G43 H2.

Re: Z-offset after tool change wrong

PostPosted: Sat Jan 21, 2023 8:10 am
by CADdy
Ok, but surely this should be set accordingly after probing the new tool?

Peter

Re: Z-offset after tool change wrong

PostPosted: Sat Jan 21, 2023 8:46 am
by dezsoe
No. Before probing, because the probing counts with the tool length offset. This is why the plugin prints the warning. If you first probe and set zero then apply the TLO then the tool will be offset by the difference between the last TLO and the new TLO.

Re: Z-offset after tool change wrong

PostPosted: Sun Jan 22, 2023 12:15 pm
by CADdy
Hi dezsoe,

you are right. This is also the error when the Z offset of a newly changed tool is not correct. The assignment of the measured tool length to the used tool is wrong. Yesterday I made some tests with the original screenset of version 1.2115. Thereby, with the same functionality, this error did not occur.

I just can't fix it unfortunately, because I do not have the programming background. But I think I have understood the problem.

Thanks a lot
Peter

Re: Z-offset after tool change wrong

PostPosted: Sun Jan 29, 2023 10:02 pm
by Parkgrr
Hi
Hijacking this as it seems to have slowed down. Having a similar issue. Quite random tool lengths, I'm sure my code just sucks. Would someone mind taking a gander at what I've written?

double ZMove = 14.8966; //Travel Distance to probe
double ZPos = exec.GetZmachpos();

exec.Callbutton(182); //Remove tool offset
double OldZpos = ZPos; // Set Old z position to current z position
ZPos = ZPos - ZMove; //Set Zpos to Zpos minus distance to probe
exec.Code("G31 Z" + ZPos + " F5.0" ); // Probes the tool length.
while(exec.IsMoving()){}
ZPos = exec.GetZmachpos();
while(exec.IsMoving()){}

if(ZPos == OldZpos) // Check if the the tool positon was found.
{
MessageBox.Show("ERROR! The tool did not hit the probe and DRO was not set");
exec.Stop();
return;
}

double Zoffset = AS3.Getfielddouble(873); //Set Zoffset to the current Z Mach coord
double Toffset = (Zoffset - ZShift); //Set Toffset to be current Z minus Zshift
exec.Code("G49"); // Cancel/delete tool offset
exec.Wait(100);
AS3.Setfieldtext("Removed Tool Offset ",2000);
AS3.Setfield(Toffset , (195+Tool));
exec.Callbutton(780); // Save tooltable
AS3.Setfieldtext("The Tool Table Is Updated ",2000);
AS3.Setfieldtext(" ",2000);
AS3.Setfieldtext("Applying G43 ",2000);
exec.Wait(1000);
exec.Code("G43 H" +Tool );
AS3.Setfieldtext(" G43 H" +Tool +" Applied ",2000);
AS3.Setfieldtext(" ",2000);
exec.AddStatusmessage("G43 Applied");

Re: Z-offset after tool change wrong

PostPosted: Mon Jan 30, 2023 8:42 am
by Parkgrr
I should note this works fine about 70% of the time. Often it will be off up to an inch.

Re: Z-offset after tool change wrong

PostPosted: Mon Jan 30, 2023 12:19 pm
by fsli
Parkgrr wrote:exec.Code("G31 Z" + ZPos + " F5.0" ); // Probes the tool length.

The axis value should be a relative distance to travel, not an absolute end point.