• Scam Alert. Members are reminded to NOT send money to buy anything. Don't buy things remote and have it shipped - go get it yourself, pay in person, and take your equipment with you. Scammers have burned people on this forum. Urgency, secrecy, excuses, selling for friend, newish members, FUD, are RED FLAGS. A video conference call is not adequate assurance. Face to face interactions are required. Please report suspicions to the forum admins. Stay Safe - anyone can get scammed.

How are work offsets calculated

jcdammeyer

John
Premium Member
I'm having trouble getting my head around how the various CNC systems deal with the work offsets.
When I home the mill the knee goes all the way down to the home switch. At this point there is 12.704" between the table the bottom of the quill. The machine Z coordinate value is 0.000"

If I place a 1-2-3 block onto the table and probe it with my T99 touch probe which has a length in the tool table of 4.829" the G54.Z value becomes -4.8571" and the machine Z position is also -4.8571"

Therefore at the point the probe trips the knee has moved the table from 0.000" up to position -4.8571 and the G54.Z space reads 0.000" when the probe tip touches the 1-2-3 block.

Now if I insert Tool #4 which has a length of 2.82042" in the tool table the G54.Z value changes to -9.6861". If I move the knee up until this new tool just scratches the top of the 1-2-3 block the Z reads 0.000 and the machine Z is now -6.8883".

I guess that makes sense. TotalDistance - 123Block - ToolLength should equal the machine position. ie. 12.704-3.0-2.82042 = 6.8836 (I have some backlash I think or tool length is 0.005" off) but close enough.

How does the system calculate the new G54.Z value?
If I change to a 4" tool how does it know what value to put into the G54.Z location?
 
Are you adding the Tool Length Offset (G43 H#) to your tool change? A tool change line should be something like T5 G43 H5 M6 where the tool is #5, and it is going to use tool length offset of tool #5 (G43 H5)
 
Are you adding the Tool Length Offset (G43 H#) to your tool change? A tool change line should be something like T5 G43 H5 M6 where the tool is #5, and it is going to use tool length offset of tool #5 (G43 H5)
I don't have any trouble with my tool change when I have a value in the tool table. The M06 replacement code does this. What it doesn't do at the moment is the correct math when the tool table value is zero and it goes and measures the tool using my tool setter.

That's what prompted all this. And the end result is I don't know how a new G54.Z is determined. Or for example say I probed while G56 was active. Then changed a tool.

How does it know what to change the G56.Z to after a number of tool changes where each tool is a different length. The tip of the tool is still supposed be able to essentially scratch the surface of what has been probed as Z==0.000

So I understand how each work space has it's own Z and that's dependant on when the Zero was set for that work.

For example. Say I use the simple AXIS interface in LinuxCNC and with a thin piece of paper between Tool #2 with a Table Tool Length of 3.5" set the top part held in the vise to 0.000. (I'm in G54).

Now change to Tool #3 that has a 1.5" length in the tool table. There's a 2" difference. The G54.Z offset should change by 2". But how does it know? Put in Tool 0 with G49 and then put in Tool #3 with G43 and it's remembered where the top of the work was in the vice.
 
Hi John, I've been trying to answer this for a bit. This is not the way it works on the Haas control at least. The G54 coordinates do not change when applying tool length compensation. From the manual:

G43 H01 turns on Tool Length Compensation +. The
H01 specifies to use the length stored for Tool 1 in the
Tool Offset display. Z0.1 commands the Z Axis to
Z=0.1.

The length of the tool is stored in the tool offset table as you say which also is described in the article you reference.

Once tool length comp is turned on then the machine adjusts (subtracts) the tool length from the current Z position of the spindle relative to the work.

e.g. So if the machine is in G54 mode and the spindle is located at Z + 5.0. (See diagram below)
then you execute G43 with a tool of length 4, the Z position of the spindle is then 1.0.

These are the four position displays on the Haas control, the work one is the usual one which makes the most sense and shows the spindle position relative to the work offset you have chosen G54, G55, etc. presuming G54 is where you set the part zero location. It was similar on my old mach3 mill.

As you fool around trying this make sure your rapid speed is set way low - I've crashed my machine interactively typing in G43 commands. :confused::eek:


1743646808939.png



1743648357753.png
 
They work in masso like in Haas control? Or they adjust the G54 z offset?
Sorry I wasn't very clear. It's my understanding that they adjust the G54-59 Z location does not change as that would mess everything up but somehow (no idea how this magic happens) the offset is used to calculate where the tip of each tool is compared to Z0. I tried it this afternoon with G54, G55 and G56 being different stacks of 1-2-3 blocks and five different tools would all hit Z0 spot on on any of the three different Z0's
 
They work in masso like in Haas control? Or they adjust the G54 z offset?
I'm not sure the G54 doesn't change when a new tool is inserted. Or at least should it change?
On my system I can see machine co-ordinates too along with whatever G5_ is active. And then there's also the G92 offset that can be added. Let's forget that one for now and just assume it's zero so it has no effect.

I do believe that since the Tormach TTS uses a gauge and a surface plate with a hole to measure tools that the tool length to the spindle nose surface is a positive number. So Tool #1 = 3", Tool #2 = 4" and Tool #99 (the probe) is 5". In fact when I go to the DRO screen it shows the TL.Z as a positive number. The TL.X and TL.Y are zero because I haven't programmed in a tool tip diameter but I probably should.

Anyway. First step is home the system. Machine G53.Z is now 0.000. Using the Touch off button on the user screen the G54.Z gets set to because there is 0 offset relative to machine G53.Z==0.000". Touching off like that implies the spindle nose it touching the table with the table at home position. But it's not of course. So if I do use the G54 workspace I really need to first do a
G10 L2 P1 Z-12.704

And as the screen shot shows, with that offset in the G54.Z location the workspace Z is now 12.702" away from the spindle nose. That's the value that was previously determined and is actually in the .ini file. So if I now did a regular G54 Z0 F40 it should stop with the nose touching the table. If I move away once again the Z value would get bigger.

Therefore inside the G-Code probing code this value is important and this value can be acquired in this way into a local variable called workheight.
#<workheight> = #<_ini[PROBE_SCREEN]WORK_HEIGHT>


1743660005677.png


So now what happens if I install a tool that is 2.702" in length? Magically the G54.Z offset should change by 2.702" to 10" since now the distance to machine coordinate 0 from the installed tool tip is only 10". And it does. If I really had a TTS tool that was 2.702" long then the tip of that tool is now 10" from the table.

When I remove the tool using the G43 H0 it goes back to the screen shot above.

1743661769303.png


And I think that's the clue as to what is happening in my system. The T15 M06 G43 I think should, in addition to going through the tool change operation request at the tool change location should just change the TLO Z to 2.702 from the tool table. The system then takes care of adjusting the Work Coordinate display to show it's now at 10" away from the table.

Yet, what happens is the G54 is changed. And that's because the M06 routine is remapped by the modified PSNG code. So I have an error in that M06 remap code.

Late now. Will continue this tomorrow.
 
Back
Top