Mach3 (Lathe) axis reversal when you change the TOOL POST from Front to Rear or vice-versa.
Mach3 lathe has tools settings in the tool table editor in this manner
The circled part is the tool post and it could be changed from front to back depending on the tool. If you set your offsets using your probe, your offsets will be set and recorded.However, when you switch your tool from front to back, when you look at your X- axis coordinates, they switch from positive to negative or vice-versa. This would cause an accident because the axis will be moving to random positions every time you move from a front post tool to a back post tool. You will notice that the tools just keep going further and further per switch.
To stop this you have to use switch the coordinates from positive to negative or vice-versa during the tool change. This should also only happen when we move from a front tool to a rear tool and vice versa. If the tool post doesn't change then nothing should happen.
---------------------------------------CODE-------------------------------------------
''************************************************************
Check whether the current tool is a front or rear tool
''************************************************************
''Dro for Front and Rear
''************************************************************
Front = 114
Rear = 115
Dim NewTool, OldTool, CurrentFR, NewFR
NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
''************************************************************
Check whether the current tool is a front or rear tool
''************************************************************
If GetOEMLED(Front) Then
Message "Front Old Tool"
CurrentFR = "Front"
ElseIf GetOEMLED(Rear) Then
Message "Rear Old Tool"
CurrentFR = "Rear"
Else
End If
''************************************************************
''Do your toolchange process
''************************************************************
''write your tool change code here
''************************************************************
''Make the selected tool the current tool and check if it is a front or a rear tool
''************************************************************
SetCurrentTool( NewTool )
If GetOEMLED(Front) Then
Message "Front New Tool"
NewFR = "Front"
ElseIf GetOEMLED(Rear) Then
Message "Rear New Tool"
NewFR = "Rear"
Else
End If
''************************************************************
''compare the post side of both tools and switch the sign if they are not similar
''************************************************************
If NewFR = CurrentFR Then
Else
SetDRO(0,-(GetDRO(0)))
End If
---------------------------------------CODE-------------------------------------------
Note: However, note that the directions in the positive and negative direction will be different for the buttons. Up will be down and down will be up
Note: The rules might change in case you have tool holders on either direction working on the job differently or on opposite sides
Comments
Post a Comment