Hello Guest it is March 28, 2024, 12:41:05 PM

Author Topic: Mill Turning_Need Advice with Mach3 Work Offsets!  (Read 6131 times)

0 Members and 1 Guest are viewing this topic.

Mill Turning_Need Advice with Mach3 Work Offsets!
« 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

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #1 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.
Without engineers the world stops
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #2 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

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #3 on: April 02, 2021, 03:40:38 AM »
have you looked in 1024 screenset to diagnostic page, normaly all offsets are in there.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #4 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #5 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #6 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
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #7 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.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #8 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #9 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