Hello Guest it is May 06, 2021, 05:03:34 PM

Author Topic: Tool offset not working after tool change  (Read 2179 times)

0 Members and 1 Guest are viewing this topic.

Tool offset not working after tool change
« on: May 08, 2012, 10:35:06 AM »
Once a tool change is called the machine correctly tool changes and registers which tool is in position. It even shows the offset of the tool in the tool information BOX, but doesn't reflect it in the dro until i turn the tool offset off then on or save the tool table.

Attached is the tool change program. Do I need to put in a tool height offset off then back on after tool is changed. It used to work properly but now it doesn't. Couldn't tell you what has changed as No setting changes have been altered or new programs installed prior to the error.

I have in the top right of my program run screen these active gcodes G0, G17,G40,G20,G94,G54,G43,G99, G64,G97
My G54 offset is already adjusted to proper settings and has not been altered.

If you do recommend putting in a tool offset off and then on please show an adjusted macro with changes in red.

'ToolChange Macro For Bed type tool changer 11/05 Brian
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 6      'Max number off tools for the changer
ToolDown   = -6.0895 'Z Pos to Get or drop a tool
ToolUp     = 0.0    'Z Hieght to Rapid from tool to tool
If NewTool = OldTool Then
   Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Code "G00 G53 X0"
While IsMoving()
Wend
Code "G00 G53 Y9.25"
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output5) 'Turn On Draw bar to release the tool
Code "G4 P1.0"    'Wait for the tool to release
'SystemWaitFor (7) 'Wait for the tool Release Limit switch
Code "G53 Z" & ToolUp
While IsMoving()
Wend
Code "G53 Y9"
While IsMoving
Wend
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output5) 'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0"    'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G53 Y9.25"
While IsMoving()
Wend
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber
       Case Is = 1
         Xpos = 9.9468       
         YPos = 4.0814         
       Case Is = 2
         Xpos = 14.4954
         YPos = 4.1001
       Case Is = 3
         Xpos = 18.9783
         YPos = 4.0795
       Case Is = 4
         Xpos = 23.4547
         YPos = 4.1055
       Case Is = 5
         Xpos = 27.9440
         YPos = 4.1055
       Case Is = 6
         Xpos = 32.4681
         YPos = 4.1084
       Case Is = 7
         Xpos = 16.00
         YPos = 4.00
       Case Is = 8
         Xpos = 18.00
         YPos = 4.00
End Select
       
       Code "G53 X" & XPos
       While IsMoving()
       Wend

       Code "G53 Y" & YPos
       While IsMoving()
       Wend

Code "G53 X" & XPos & " Y" & YPos
End Sub
Main           

Re: Tool offset not working after tool change
« Reply #1 on: May 09, 2012, 08:35:52 PM »
anyone
Re: Tool offset not working after tool change
« Reply #2 on: May 10, 2012, 09:44:36 PM »
fixed it with an g49 and g43 at the end of the code