1
General Mach Discussion / Tool probe macro
« on: December 12, 2009, 08:44:57 PM »
I'm having problems with my tool probe macro. It's one that I had modified from one that I found posted on this forum. The probe is one with a spring loaded plate that is mounted permantly to the table of my mill.
Sometimes the tool will stop short of the plate and go home, so I usually jog closer to the probe. Sometimes it will feed AWAY from the probe. Pressing ESC will stop the feed and it will rapid home. It usually works fine, I get repeatability of .001" or so, but these actions really have me baffled.
Thanks in advance
Mark
If IsSuchSignal (22) Then
Fixture_Num = GetOEMDRO(46)
Call SetOEMDRO (46, 202) 'Set to fixture number 202
Code "G0 G53 Z00." 'Height to move into probe pos
Code "G59 p202 X0. Y0." 'Move into Probe Pos ***EDIT HERE***
Tool_Number = GetDRO(24)
code "G91 g31 z-6. f10."
While IsMoving()
Wend
If Tool_Number = 0 Then 'Master tool Cal
z = GetOEMDRO(85) 'get Machine ZPos
Call SetOEMDRO(49,z) 'Set fixture offset
Else
Call SetDRO(24,0) 'Turn off the tool offset by loading tool #0
Height = GetDRO(2) 'Get the pos of the Z axis without the Tool comp on
Call SetDRO(24,Tool_Number) 'Turn the tool Back on so the offset will go to the
Call SetoemDRO(42,Height) 'Set the Tool Height offset
End If
Call SetOEMDRO(46,Fixture_Num) 'Set the Fixture back to what it was
Code "G49"
code "G0 G90 G53 Z0.0"
While IsMoving()
Wend
End If
Sometimes the tool will stop short of the plate and go home, so I usually jog closer to the probe. Sometimes it will feed AWAY from the probe. Pressing ESC will stop the feed and it will rapid home. It usually works fine, I get repeatability of .001" or so, but these actions really have me baffled.
Thanks in advance
Mark
If IsSuchSignal (22) Then
Fixture_Num = GetOEMDRO(46)
Call SetOEMDRO (46, 202) 'Set to fixture number 202
Code "G0 G53 Z00." 'Height to move into probe pos
Code "G59 p202 X0. Y0." 'Move into Probe Pos ***EDIT HERE***
Tool_Number = GetDRO(24)
code "G91 g31 z-6. f10."
While IsMoving()
Wend
If Tool_Number = 0 Then 'Master tool Cal
z = GetOEMDRO(85) 'get Machine ZPos
Call SetOEMDRO(49,z) 'Set fixture offset
Else
Call SetDRO(24,0) 'Turn off the tool offset by loading tool #0
Height = GetDRO(2) 'Get the pos of the Z axis without the Tool comp on
Call SetDRO(24,Tool_Number) 'Turn the tool Back on so the offset will go to the
Call SetoemDRO(42,Height) 'Set the Tool Height offset
End If
Call SetOEMDRO(46,Fixture_Num) 'Set the Fixture back to what it was
Code "G49"
code "G0 G90 G53 Z0.0"
While IsMoving()
Wend
End If