Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: rey8801 on April 01, 2021, 03:26:10 PM

Title: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 01, 2021, 03:26:10 PM
Hello  :)!

I am really happy with Mach3, I have been using it on several 3-4 axis mills and made custom screensets, macros ecc... with it. FOr been an old soul it's still really capable.
Now I am approaching Mill Turning (3 axis vertical mill used as a lathe) and after I have made few parts with the the lathe tools in the vise, I am about to make a jig to use it as a gang tooling station (picures below). In order to be able to use this fixture on the mill I can not simply use the stock Mach3 turning post processor from Fusion360 since it doesn't output a Y offset. Same goes for the Mach3 Turn screeset. Y axis is not commonly used on a stardard lathe. To overcome this issue, I thought to use the work offsets (G54 / G55 / G56...), instead of the standard tool offsets that only allow X and Z offsets, to locate the cutting points of the different tools. In order to do so, I modified the stock Mach3 Turning post processor in Fusion360 to search in the "comment tab" of the tool (you set it in the tool table in Fusion360) for the words G54...G55 ecc... if it finds them then it replaces the work offset in the gcode instead of the orginal one set in the CAM set up. Below an exemplary GCode (I added some comments to explain the steps).
After a new tool is called in the GCode, a new work offset it also outputs followed by a "G0 Y0" command to rapid move to the new Y position. X and Z are then already covered in the Mach3 Turning Post Processor, so nothing to change there. This system works really well, but I would like to improve the tool locating part in mach3. Up to now I probe all the tools, using G54 for the "master tool", then G55 for the 2nd one ecc... until I located all the tools, one for each work offset. I then move back to G54 X0, Y0 and Z0 and I have all the offsets of the other work offsets in comparison to G54 (in G54 XYZ0 switch to G55, G56 to see the offsets). At this point I note down these offsets in an Excell file and whenever I remove the gang tooling jigs I would just need to relocate G54 and manually apply those offsets for each of the remaining G5X in used.
I hope I gave enough infomation to undrstand the principle. My quesiton is: Is there a way in Mach3 to save those offsets in relation to G54 and call them back when I need? If I use the inbuilt Work Offsets table, the offsets are saved in relation to G53 so everyhting works as long I do not move the gang tooling fixture, but that it's not a solution since I need to use the mill for different works too. I would need something like that, but instead of having the offsets in relation to G53, they are in relation to a work offset (in my case would be G54).
I know there is the G92 command, but then I would need to add the offsets in the post process in Fusion360 and that is risky because if I change something I need to go back every time to update the post processor.


"
%
(OP1 TEST G96-97)
(MACHINE)
(  VENDOR OPTIMUM)
(  DESCRIPTION OPTIMUM BF20L LATHE)
(T0202 NR=0.4 - ZMIN=-39.162 - GENERAL TURNING)
G90 G94 G18
G21
G53 G0 Z-5.

(FACE1 3)
T0202          // tool called from Fusion360 tool table
(G55)          // words found in the comment tabs of Fusion360 tool table
G55 P0        // G55 is output instead of the stock G54 using the format G5X PX
M7              // Rest of the gcode is standard. At the next operation, the same rules are applied
G94
G97 S984 M3
G0 Y0.
G0 X24.25 Z5.
M48 S2500
G96 S150 M3
G0 Z1.337
X22.25
G1 X21.664 F160.
X20.25 Z-0.077
X-0.4
X1.014 Z1.337
G0 X22.25
Z1.237
G1 X21.664 F160.
X20.25 Z-0.177
X-0.4
X1.014 Z1.237
G0 X22.25
Z1.137
G1 X21.664 F160.
X20.25 Z-0.277
X-0.4
X1.014 Z1.137
G0 X22.25
Z1.037
G1 X21.664 F160.
X20.25 Z-0.377
X-0.4
X1.014 Z1.037
G0 X22.25
Z0.937
G1 X21.664 F160.
X20.25 Z-0.477
X-0.4
X1.014 Z0.937
G0 X22.25
Z0.837
G1 X21.664 F160.
X20.25 Z-0.577
X-0.4
X1.014 Z0.837
G0 X24.25
Z5.
G97 S984 M3
M9
G53 G0 Z-5.

(PROFILE FINISHING1 3)
M1
T0200
(G55)
G55 P0
M7
G94
G97 S789 M3
G0 Y0.
G0 X30.25 Z5.
M48 S2500
G96 S150 M3
G0 Z1.133
X7.12
G1 X6.555 Z-0.785 F140.
X9.525 Z-6.234
Z-35.781
X18.435
X19.05 Z-36.397
Z-39.162
X20.25
Z-37.162
X21.05
G0 X30.25
Z5.
G97 S789 M3

M9
G53 G0 Z-5.
M30
%
"

Thank you very much for the help!

Ciao ciao,
Alessio
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: Graham Waterworth on April 01, 2021, 08:31:52 PM
You can use a Macro and have that set a G52 offset in XYZ for the given tool.  then you could tell Fusion to output M600 P1 or M600 P2 etc.  and at the end of the run call M600 P0 to cancel the G52.

for example the macro could look something like this:-

M600.m1s
nxt = Param1()
if nxt = 0 then
  code "G52 x0 y0 z0"
end if
if nxt = 1 then
  code "G52 X-25. Y25. Z21."
end if
if nxt = 2 then
  code "G52 X-25. Y-25. Z22."
end if
if nxt = 3 then
  code "G52 X25. Y-25. Z23."
end if
end

In your code you issue :-

M600 P1
G00 X0 Y0 Z10.

This way you always clock the same point on the tool fixture and the local G52 offsets in the macro take care of the rest.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 03:13:44 AM
Thank you Graham!

Indeed, this should work really well.
I will probably make "User defined DRO" in the screenset were I can log all the different offset for each M600 Px value and call them in the Macro M600. So if I need to change those offset I can do it in the screenset and not in the macro.

Do you know whether is possible to display this temporary workoffset on the screenset? In case I need to stop the work and resume, would be useful to have like a "Relative WCS" field with P1 /P2 ecc... I know how to make the screenset, but not sure how I can call those Px value to be display in the screenset.

Thank you
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 02, 2021, 03:40:38 AM
have you looked in 1024 screenset to diagnostic page, normaly all offsets are in there.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 02, 2021, 03:44:55 AM
here:

https://www.machsupport.com/forum/index.php?topic=25409.0

are some variables listed where Offsets are stored.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 02, 2021, 04:14:13 AM
would be great if you share your findins/experiences.

i am thinking to do the same on my Tongil Mill.
i whanted to use a customised M6 macro for the tool offset's, so every "Standard" turn postprocessor would work
to create the code.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 06:17:21 AM
have you looked in 1024 screenset to diagnostic page, normaly all offsets are in there.

Hi!

Yes I can see the offset but if I want to store them in the work offset tool table they will be in relation to G53, so if I move the gang tooling fixture I would have to update them every time. I need something that it's in relation to a single work offset position, for instance using G52 like Graham suggested. I will give it a try and then see if it's work good for me
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 06:19:06 AM
would be great if you share your findins/experiences.

i am thinking to do the same on my Tongil Mill.
i whanted to use a customised M6 macro for the tool offset's, so every "Standard" turn postprocessor would work
to create the code.

Sure if I get something that is worth pubblish, I will put it online with a description too.
The best would be to have a Y offset page in the Turn Tool Table instead of only X and Z. I do not know how to do that. That's why I am using the work offset.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 02, 2021, 06:35:56 AM
The best would be to have a Y offset page in the Turn Tool Table instead of only X and Z. I do not know how to do that. That's why I am using the work offset.

did something simular on my Tongil, because it can have SK40 and BT40 tool holder's and i had to know witch type it is for
ATC because Z Position is different. i made this by VB script and stored the Information in an extra text file. additional i stored
Information witch tool number is in witch ATC place so i do not have to remeasure Offsets because i have more Tools then
ATC places. simular to tool Offset handling in lathe mode but for mill.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 12:27:42 PM
You can use a Macro and have that set a G52 offset in XYZ for the given tool.  then you could tell Fusion to output M600 P1 or M600 P2 etc.  and at the end of the run call M600 P0 to cancel the G52.



OK Here where I am now.
So I made the new M1002 macro to cover this task (M600 was already taken  ;D)
I created a Relative Work Offsets table in the DIagnostic page of my custom screenset, so I can populate the G52 offsets from the X,Y,Z DRO and call them back with the M1002 the macro. Once a new G52 offsets is applied you get the relative message at the bottom of the screenset and also updated in the "REL WCS" window. For the moment if I saved the offsets as positive they are called as negative, I think is correct but I will just try and in case reverse the signal in the Macro if needed. Another thing I noticed is that if I am in DIAMETER mode then the X value are entered double like to convert radius to diameter. Need to see if that is an issue, I cna always /2 in the macro or use the screenset in RADIUS mode.
I will now modify the Post Processor to output M1002 Px for each new tool.
Below I have attache dfew pictures to show the screenset and few useful info. Time to test it!

For the moment the script I used are:

1st:
'Script to transfer X,Y,Z DRO to the corresponding G52 Px line in the table (each button transfers to different SetUserDRO ( *********x, Xdro) ecc...)
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro)
SetUserDRO (1101, Ydro)
SetUserDRO (1102, Zdro)



2nd:
'1002 Macros to call G52 X,Y,Z offsets from a given WorkOffsets (G54 usually)
DoSpinStop()                     ' Make sure the spindle is OFF
Code"M09"                        ' Make sure the coolant is OFF
nxt = Param1()
If nxt = 0 Then
  code "G52 X" & GetUserDRO (1100) & "Y" & GetUserDRO (1101) & "Z" & GetUserDRO (1102)
End If
If nxt = 1 Then
  code "G52 X" & GetUserDRO (1103) & "Y" & GetUserDRO (1104) & "Z" & GetUserDRO (1105)
End If
If nxt = 2 Then
  code "G52 X" & GetUserDRO (1106) & "Y" & GetUserDRO (1107) & "Z" & GetUserDRO (1108)
End If
If nxt = 3 Then
  code "G52 X" & GetUserDRO (1109) & "Y" & GetUserDRO (1110) & "Z" & GetUserDRO (1111)
End If
If nxt = 4 Then
  code "G52 X" & GetUserDRO (1112) & "Y" & GetUserDRO (1113) & "Z" & GetUserDRO (1114)
End If
If nxt = 5 Then
  code "G52 X" & GetUserDRO (1115) & "Y" & GetUserDRO (1116) & "Z" & GetUserDRO (1117)
End If
.... 'Here I will add all the other nxt = 6,7,8,9...14

SetUserLabel (15,"G52 P" & nxt) 'Display the new G52 Px offset on the screenset
Message "Relative WorkOffset G52 P" & nxt 'Display the new G52 Px offset on the screenset as INFO Message
End
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 02, 2021, 12:42:21 PM
Looks great so far, let's see what the testing will bring up.

as mentioned earlier, if you put this code in M6 and a:

Code: [Select]
newtool = GetSelectedTool() ' get the newtool

at the begining a Standard postprocessor should be ok.

good luck for testing. :)
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 01:00:47 PM
Ah yes that is already there but in this case it just updates the tool number but no offsets are applied to the tools. All the offsets are handled within the M1002 macro and output as G52 X Y Z offsets.
Let's see what the tests give
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 02, 2021, 01:35:41 PM
Post Processor modied accordingly to output M1002 Px based on the tool comment section

Exemple below:
%
(OP1 TEST G52)
(MACHINE)
(  VENDOR OPTIMUM)
(  DESCRIPTION OPTIMUM BF20L LATHE)
(T0101 NR=0.4 - ZMIN=-0.577 - GENERAL TURNING)
(T0202 NR=0.4 - ZMIN=-38.762 - GENERAL TURNING)
G90 G94 G18
G21
G53 G0 Z-5.   //when a tool change or new operation is issued it outputs a G53 Z-5 command to clear the field

(FACE1 3)
T0101         //tool change
(G52P0)      //corresponding tool comment
M1002 P0    //calls the 1002 macro with P0 meaning G52 X0Y0Z0
M7
G94
G97 S1100 M3
G0 Y0.        // always call a Y0 to compensate for the different Y positions
G0 X48.5 Z5.
G0 Z1.337
X44.5
G1 X43.328 F160.
X40.5 Z-0.077
X-0.8
X2.028 Z1.337
G0 X44.5
Z1.237
G1 X43.328 F160.
X40.5 Z-0.177
X-0.8
X2.028 Z1.237
G0 X44.5
Z1.137
G1 X43.328 F160.
X40.5 Z-0.277
X-0.8
X2.028 Z1.137
G0 X44.5
Z1.037
G1 X43.328 F160.
X40.5 Z-0.377
X-0.8
X2.028 Z1.037
G0 X44.5
Z0.937
G1 X43.328 F160.
X40.5 Z-0.477
X-0.8
X2.028 Z0.937
G0 X44.5
Z0.837
G1 X43.328 F160.
X40.5 Z-0.577
X-0.8
X2.028 Z0.837
G0 X48.5
Z5.
M9
G53 G0 Z-5.

(PROFILE FINISHING1 3)
M1
T0202
(G52P1)      //new tool same story
M1002 P1    // P1 would be G52 X Y Z based on the user DRO in Mach3 screenset
M7
G94
G97 S1100 M3
G0 Y0.
G0 X60.5 Z5.8
G0 Z1.933
X14.24
G1 X13.11 Z0.015 F160.
X19.05 Z-5.434
Z-20.404
X38.1 Z-35.647
Z-38.762
X40.5
Z-36.762
X42.1
G0 X60.5
Z5.8

M9
G53 G0 Z-5.
M30
%


Time for testing!
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: Graham Waterworth on April 02, 2021, 09:20:51 PM
You could if you want use the fixture offsets to hold the G52 XY & Z values and read them using #5221 onward.

If you then want to change an offset on the fly its easy to change the fixture value.

Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 03:45:13 AM
You could if you want use the fixture offsets to hold the G52 XY & Z values and read them using #5221 onward.

If you then want to change an offset on the fly its easy to change the fixture value.


Damn didn't know 😅. The fixture offsets table seemed be capable of holding only the standard offsets G54, G55 ecc... Still not sure how can I log those?
Do you have a shortcut to open the fixture offset table? Or a OEM code to make a button? In the 1024 screenset I only found the save button and not always I want to press it to open the table.

That is the thing. Is there a repository where I can find the VB script variables, the OEM codes, pictures like the one you posted know. I often read screen hunter as title of picture but never found anything containing all this info.
I only have an excell file with all the OEM code found but no no more. For the VB parameters I open several macros and try to find what I need.

Thanks a lot for the help
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 03, 2021, 05:20:08 AM
dont know a OEMButton to open fixture table, but:

Code: [Select]
  DoMenu(1, 9)

should do the same.

here: https://www.machsupport.com/forum/index.php?topic=19482.0
is an other list i use.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 05:56:52 AM
Thank you very much. This helps a lot!
Still not clear how I can save the G52 offset in the tool table but I will have a look.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 03, 2021, 07:29:01 AM
for the moment i am sure what you realy try to do.

now you are talking of the tool table?

to store values in the tooltable in lathe mode the following will store X/Z

Code: [Select]

SetToolParam(ToolNo,3,XOffset) 'write X
SetToolParam(ToolNo,4,YOffset) 'write Y
DoOEMButton(316) 'save tooltable


but there is nothing for Y to store.

you can use one of the wear values
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 08:01:57 AM
for the moment i am sure what you realy try to do.

now you are talking of the tool table?

to store values in the tooltable in lathe mode the following will store X/Z

Code: [Select]

SetToolParam(ToolNo,3,XOffset) 'write X
SetToolParam(ToolNo,4,YOffset) 'write Y
DoOEMButton(316) 'save tooltable


but there is nothing for Y to store.

you can use one of the wear values


Sorry, my bad. I meant how to store the G52 offset in the work offsets table. Not the tool table.
Graham mentioned that is possible to save the G52 offsets in the work offsets table.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 03, 2021, 08:17:23 AM
this will read G52 (X/Y/Z) and write G54

Code: [Select]
X=GetVar(5211)
Y=GetVar(5212)
Z=GetVar(5213)

SetVar(5221,X)
SetVar(5222,Y)
SetVar(5223,Z)

Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 10:16:48 AM
Still did not get it how they will be displayed in the work offsets table. I am going to test the changes I have made so far and try it out few things regarding the work offsets table. Maybe I will understand like that. Sometimes I need to see things to get it better
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 03, 2021, 11:09:39 AM
in the work Offset table are no  G52 values, only G54 ...

G52 values are only avaliable in Vars (5211 ...)

so what is the problem to have these offset's stored in UserDro's like you did?
and why are you trying to store G52 offset's in work offset table?
for the moment i can't catch the entire Problem.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 02:53:28 PM
in the work Offset table are no  G52 values, only G54 ...

G52 values are only avaliable in Vars (5211 ...)

so what is the problem to have these offset's stored in UserDro's like you did?
and why are you trying to store G52 offset's in work offset table?
for the moment i can't catch the entire Problem.

No problem at all. It's ok to have them saved in the screenset table I have made.
Graham in a previous post suggested that it's also possible to save G52 offsets in the workoffset table and I was just curious about it.
Anyhow run few tests and it seems to work really well. Modified the post processor to output a G0 Y0 X0 instead of only YO. To prevent crashes in case of diagonal long travels once the new offsets is called. Now it goes on top of the new offset and then start with the rest of the Gcode.

Here a short video showing same operation at different constant surface speed in 5 different locations. Once established the offset, I only need to change the G54 and the macro will take care of the rest.
Thanks a lot for the help!

https://youtu.be/ZUQ1dGvLo-Q
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 06:45:54 PM
Made a mistake on YouTube, I uploaded again on another platform 😊
<iframe title="vimeo-player" src="https://player.vimeo.com/video/532719675" width="640" height="360" frameborder="0" allowfullscreen></iframe>
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 03, 2021, 06:50:50 PM
I was playing a bit with VB editor.
Does someone know if it is possible to reverse the sign of a DRO value?
Like in this code, would be possible to reverse the signs of the variables X,Y and Zdro? I couldn't find the VB code for it.

1st:
'Script to transfer X,Y,Z DRO to the corresponding G52 Px line in the table (each button transfers to different SetUserDRO ( *********x, Xdro) ecc...)
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro)
SetUserDRO (1101, Ydro)
SetUserDRO (1102, Zdro)

Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: Graham Waterworth on April 03, 2021, 08:34:27 PM
The 'Work Offsets' are stored in a block of #Vars starting at #5221 for G54 X, #5222 for Y and #5223 for Z

To get to G55 you increment the base value by 20 so #5241 = G55's X value.

I have used this method for storing probed points and the like when the control had limited spare #vars.

I would suggest using G59 P100 and above to read and write user values.

So the base value would be #7201 for your tool one X value.

You can write them with #[7201 + [tool * 20]] = GetOEMDRO (800)

And read them with G52 X[#7201 + [tool * 20]], Y[#7202 + [tool * 20]], Z[#7203 + [tool * 20]] or use the Get/Setvar method or some variation of your own.

You can open the fixture table with Oem Code 122
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 04, 2021, 03:21:50 AM
The 'Work Offsets' are stored in a block of #Vars starting at #5221 for G54 X, #5222 for Y and #5223 for Z

To get to G55 you increment the base value by 20 so #5241 = G55's X value.

I have used this method for storing probed points and the like when the control had limited spare #vars.

I would suggest using G59 P100 and above to read and write user values.

So the base value would be #7201 for your tool one X value.

You can write them with #[7201 + [tool * 20]] = GetOEMDRO (800)

And read them with G52 X[#7201 + [tool * 20]], Y[#7202 + [tool * 20]], Z[#7203 + [tool * 20]] or use the Get/Setvar method or some variation of your own.

You can open the fixture table with Oem Code 122

Woow! Ok this is something cometely new that I didn't know. Although I used Mach3 for the past 3 years everytime surprises me with a new aspect.
Thanks for the highlights.


Do you perhaps know the VB code to reverse the sign of a DRO? (I mentioned in the previous message).
Thanks a lot
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: TPS on April 04, 2021, 03:32:12 AM
is this what you are looking for to invert sign:

Code: [Select]
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro * -1.0)
SetUserDRO (1101, Ydro * -1.0)
SetUserDRO (1102, Zdro * -1.0)
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: rey8801 on April 04, 2021, 03:45:13 AM
is this what you are looking for to invert sign:

Code: [Select]
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro * -1.0)
SetUserDRO (1101, Ydro * -1.0)
SetUserDRO (1102, Zdro * -1.0)

Ah right! That was easy. Thanks a lot
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: kf2qd on April 19, 2022, 02:39:35 PM
I think this will do what you want to do.

Yo know the offset of your first tool and you know the X offset from your first tool to every other tool in the block.

Parameter #5221 is G54X, #5222i is G54Y and 5223 is G54Z. #5241 is G55X, #5261 is G56X, #5281 is G57X and I think you should be able to see the pattern here.

So - to set several work offsets in X you worls do this -

%
(this assumes G54 it the first tool on the block)
(an this assumes that you only need to adjust the X value for the tools in the block )
(G54 will be set using whatever method you normally use to set a fixture offset)
(to set G55X for tool 2)
#5241=[#5221 + .875] (G55 is +.875 from G54)
#5242=#5222 (so the Y is correct)
#5343=#5223 (unless the Z locations change)
#5261=[#5221 +2.1] (G56 is +2.1 from G54)
#5262=#5222 (so the Y is correct)
#5363=#5223 (unless the Z locations change)

This also works for normal mill work.
G54
M98P1
G55
M98P1
G56
M98P1
(Do a tool change)
G54
M98P2
and so forth
Write this into the header of the programs that use this tool block and just set G54.
Title: Re: Mill Turning_Need Advice with Mach3 Work Offsets!
Post by: kf2qd on April 19, 2022, 02:51:30 PM
Use the Mach3 Parameters -
#5221 is G54X, #5222 is G54Y, #5223 is G54Z, #5241 is G55X, #5261 is G56X, #5281 is G57X and I think you can see the pattern here.

#5241=[#5221 +.875] (or whatever the distance is)
#5242=#5222 (so the Y is correct)
#5343=#5223 (unless the Z locations change)

And repeat for each tool.
You can put this in its own .NC file or at the head of each file that uses that tool block

Also works for general milling -
Set first tool
G54
M98P1
G55
M98p1
G56
M98P1
Set Second tool
G54
M98P2
G55
M98P2
G56
M98P2
and so on