Hello Guest it is July 22, 2019, 09:23:49 PM

Author Topic: Auto tool measuring and offsets  (Read 12480 times)

0 Members and 1 Guest are viewing this topic.

Auto tool measuring and offsets
« on: April 10, 2012, 10:51:00 AM »
I would like to set up a tool measuring system and offsets. This is a macro Brian posted that I liked.

Here is what I would like to do. Tool 1 or No tool in spindle will be the reference (Zeroed at table top), then I would like to measure the other tools and set the offsets automatically. I would like there to be a regular probe speed for first touch then a slow speed for second touch and use the second touch position. Then save tool offsets for each tool number.

If I could set up a macro for all six tools. And a macro to do current tool only.

Please chime in if there is a better way, but I do have hall effect sensor limit switches for homing and even the tool measure so accuracy and repeatability are not an issue, and don't really need to measure during tool changes.

So having a macro to measure tool in use, is basically used for if a tool is changed you can just measure and reset offset for the one tool. The macro for all six, I would like to have for say beginning of the week to recheck all tools.

Any input is appreciated.

 :) Thanks,

David


Xpos = GetDRO(0) 'Get the X and Y position
Ypos = GetDRO(1)
Code "G53 G00 Z-.1" 'Move the tool all the way up
Code "G53 G00 X3.5 Y6.00" 'Move to the probe position
While IsMoving()
Wend
Zpos = GetDRO(2)'Get the Zpos
Code "G31 Z" & Zpos - 5 & " F30" 'Probe down 5 Units
While IsMoving()
Wend
Zpos = GetVar(2002) 'Get the Position that the Porbe hit at
Code "G00 Z" & Zpos' Move to the point where the probe hit
While Ismoving()
Wend
Call SetDRO(2,0.000) 'Set the Z to 0.00
Code"G53 G00 Z-.1" 'Pick the tool up to the home switch
Code"G00 X" & Xpos & "Y" & Ypos 'Move to the point where the tool change started
Re: Auto tool measuring and offsets
« Reply #1 on: April 10, 2012, 02:16:27 PM »
OK,
here is my finished script for tool length offset setting with a permantly installed probe:

If IsSuchSignal (22) Then
Code "G49"
Code "G0 G53 Z00." 'Home Z
code "G53 X0 Y3.125" 'Move into Probe Pos ***EDIT HERE***
DoOEMButton(179) ' machine coordinates
Tool_Number = GetDRO(24)
code "G91 g31 z-9. f20."
While (IsMoving())
  Sleep 30
Wend

code " g0 z.2"

code "G91 g31 z-9. f3."
While (IsMoving())
  Sleep 10
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

DoOEMButton(181) back to program coordinates
code "G0 G90 G53 Z0.0"
code "G43"
While (IsMoving())
  Sleep 10
Wend
End If

Mark


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


(I am thinking this is something that I am looking for What do you think.)

« Last Edit: April 10, 2012, 02:19:02 PM by davy182 »

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto tool measuring and offsets
« Reply #2 on: April 10, 2012, 07:04:10 PM »
I'd turn off the offset with:
Code "G49"
And turn it on with :
Code "G43 H" & Tool_Number


You can right the tool length to the tooltable after probing with:
Code "G10 L1 P" & Too_Number & " Z" & ToolLength
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto tool measuring and offsets
« Reply #3 on: April 10, 2012, 09:52:11 PM »
If IsSuchSignal (22) Then
Code "G49"
Code "G0 G53 Z00." 'Home Z
code "G53 X0 Y3.125" 'Move into Probe Pos ***EDIT HERE***
DoOEMButton(179) ' machine coordinates
Tool_Number = GetDRO(24)
code "G91 g31 z-9. f20."
While (IsMoving())
  Sleep 30
Wend

code " g0 z.2" What Do I need to put here to retract .2 from where probe triggered from first time above

code "G91 g31 z-9. f3."
While (IsMoving())
  Sleep 10
Wend

If Tool_Number = 0 Then 'Master tool Cal
z = GetOEMDRO(85) 'get Machine ZPos
Call SetOEMDRO(49,z) 'Set fixture offset
Else

code "G49"
Height = GetDRO(2) 'Get the pos of the Z axis without the Tool comp on
code "G43 H" & Tool_Number
code "G10 L1 P" & Tool_Number & "Z" & ToolLength

End If

DoOEMButton(181) back to program coordinates
code "G0 G90 G53 Z0.0"
code "G43"
While (IsMoving())
  Sleep 10
Wend

How does that look.

Offline BR549

*
  •  6,874 6,874
    • View Profile
Re: Auto tool measuring and offsets
« Reply #4 on: April 10, 2012, 10:55:05 PM »
If IsSuchSignal (22) Then
Code "G49"
Code "G0 G53 Z00." 'Home Z
code "G53 X0 Y3.125" 'Move into Probe Pos ***EDIT HERE***
DoOEMButton(179) ' machine coordinates
Tool_Number = GetDRO(24)
code "G91 g31 z-9. f20."
While (IsMoving())
  Sleep 30
Wend

PRP = (GetParam(2002) +.2)  'Get the touch point value and add the .2 to it (Probe Retract Point)

code " g0 z"  & PRP       'What Do I need to put here to retract .2 from where probe triggered from first time above

code "G91 g31 z-9. f3."
While (IsMoving())
  Sleep 10
Wend
Re: Auto tool measuring and offsets
« Reply #5 on: April 10, 2012, 11:17:35 PM »
Looks great can't wait to try it. One last thing what would I need to add to this macro to go through all seven tools automatically(0 ref(no tool in spindle), 1 ,2 ,3,4,5,6) so as to have a single tool offset and set all tool offsets.

Offline BR549

*
  •  6,874 6,874
    • View Profile
Re: Auto tool measuring and offsets
« Reply #6 on: April 10, 2012, 11:30:29 PM »
I would get it working as you want it with a single tool then work from there. It is just a matter of repeating what you did the first time.

You start with the master tool and reference all the rest of the tools to it. Then you set you master tool to the Part Z0.00 then when you cycle the tools the offsets follow the tools.

Just remember whne Mach3 cycles the tool offsets it must have room to safely make the offset move without crashing into something or limiting out.

As a rule I always make the master tool the longest tool. That way the spindle is always moving away from the upper stop and can not hit the upper limit switch when Mach3 cycles the tool offsets.

Justa thought, (;-) TP
« Last Edit: April 10, 2012, 11:33:30 PM by BR549 »
Re: Auto tool measuring and offsets
« Reply #7 on: April 11, 2012, 10:17:18 AM »
Ok we have good movement UNTIL ??? we reach in red




code "G49"
code "G0 G53 Z00."
code "G53 X1.1014 Y4.825"
DoOEMButton(179)
Tool_Number = GetDRO(24)
code "G31 z-6 f20."
While (IsMoving())
Sleep 30
Wend

PRP= (GetParam(2002)+.2)

code "G0 z" & PRP

code "G31 z-6. f3."
While (IsMoving())
Sleep 10
Wend

If Tool_Number =0 Then
z= GetOEMDRO(85)
Call SetOEMDRO(49,z)
Else

code "G49"
Height = GetDRO(2)
code "G43H" & Tool_Number
code "G10L1P" & Tool_Number & "Z" & ToolLength
End If

DoOEMButton(181)
Code "G0 G90 G53 Z0.0"
Code "G43"
While (IsMoving())
Sleep 10

What it is doing is going to work coordinates .2 not trigger point plus .2 machine coordinates.

Re: Auto tool measuring and offsets
« Reply #8 on: April 11, 2012, 11:53:22 AM »
ok I got rid of the problem by changing it to

PRP=(GetVar(2002)+.2)
Re: Auto tool measuring and offsets
« Reply #9 on: April 11, 2012, 12:58:18 PM »
Here is what I changed in order to get the offset to be stored.


code "G49"
Height = GetDRO(2)
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
code "G43H" & Tool_Number
code "G10L1P" & Tool_Number & "Z" & ToolLength
End If

DoOEMButton(181)
Code "G0 G90 G53 Z0.0"
Code "G43"
While (IsMoving())
Sleep 10
Wend    

And It works great. It stores the values in the tool table for the correct tool number.
The only thing I get is "No Characters Found In Reading Real Value" in the status bar."