Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: vmax549 on June 20, 2007, 06:27:15 PM

Title: Tool Height Touch Probe
Post by: vmax549 on June 20, 2007, 06:27:15 PM
OK I had a moment and I put together a tool touch probe. Now you fellows have to help me figure out the best way to use it. Does anyone have a macro already setup to use it?? That would really help.

5 test runs @ 1 IPM and it returned a measurement with less than .0001 error each time, not bad for hardware/RShack parts.


The NEW Screen Page is complete just need to finish up some of the Scripting and it will be done.



Title: Re: Tool Height Touch Probe
Post by: Chaoticone on June 20, 2007, 08:26:04 PM
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness =0.062
ProbeFeed = 5


Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
'Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z2.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If   

I hope this helps.
Brett
Title: Re: Tool Height Touch Probe
Post by: vmax549 on June 20, 2007, 09:17:51 PM
Thanks THat will get me started. Does anyone have a macro that allows me to test all the tool heights and reset the tool table values for each tool??  I believe I said that right(;-)

Or something to get me started in the right direction, Perhaps help make this page work

(;-) TP
Title: Re: Tool Height Touch Probe
Post by: Scott on June 21, 2007, 06:52:27 PM
Don't know if this helps, but heres a touch probe macro that finds the difference between lengths during a manual tool change and sets the new tool to the same height as the one that was removed.  It was made for someone else so your mileage may vary.   ;)

Take note that it has some user DRO's that are used.

ChX = GetUserDRO(1200)
ChY = GetUserDRO(1201)
ChZ = GetUserDRO(1202)
Swposx = GetUserDRO(1203)
Swposy = GetUserDRO(1204)
SwError = GetUserDro(1205)
CurrentFeed = GetOemDRO(818)

If GetOemLed (23) Then DoOemButton (119) 'Turn soft limits off

Code "G20" 'Set to inch units

Code "G53 G00 Z" &ChZ 'Move the tool all the way up
While IsMoving()
Wend
ZOld = Getdro(2)

Code "G53 G00 X" &Swposx & "Y" &Swposy 'Move to the switch position
While IsMoving()
Wend

MsgBox ("Jog Z axis down close to switch then hit Cycle Start to resume")
SystemWaitFor (Start) 'Pause macro to jog the Z axis close to the switch

Code "G31 Z-7 F10" 'Move Z down until switch is triggered
While IsMoving()
Wend
Code "G4 P0.1"
HitOld = GetVar(2002) 'Get the position where the switch was triggered
Code "G53 G00 Z" &ChZ 'Z move all way up
Code "G53 G00 X" &ChX & "Y" &ChY 'Move to change tool position
While IsMoving()
Wend

MsgBox ("Insert the new tool")

Code "G53 G00 X" &Swposx & "Y" &Swposy 'Move to the switch position
While IsMoving()
Wend

MsgBox ("Jog Z axis down close to switch then hit Cycle Start to resume")
SystemWaitFor (Start) 'Pause macro to jog the Z axis close to the switch

Code "G31 Z-7 F10" 'Z move down until switch is triggered
While IsMoving()
Wend
Code "G4 P0.1"
HitNew = GetVar(2002) 'Get the position where the switch was triggered
Code "F" &CurrentFeed

Diff = HitOld - HitNew
DiffABS =Abs(Diff)

If DiffABS=0 Then
Code "G53 G00 Z" &ChZ
Code "G53 X0Y0"
While Ismoving()
Wend
DoOemButton (119) 'Turn soft limits on
Code "(New tool is now ready for use)"
Exit Sub
End If

ZNew=0

If HitOld < HitNew Then ZNew = ZOld - DiffABS :A=1
If HitOld > HitNew Then ZNew = ZOld + DiffABS :A=2

Code "G53 G00 Z" &ChZ
While IsMoving()
Wend
Call setdro(2,ZNew - SwError)
Code "G53 X0Y0"
While Ismoving()
Wend
DoOemButton (119) 'Turn soft limits on
Code "(New tool is now ready for use)"
End   

Title: Re: Tool Height Touch Probe
Post by: vmax549 on June 21, 2007, 07:25:29 PM
Thanks SCOTT, I believe I have a use for that one also (;-) TP
Title: Re: Tool Height Touch Probe
Post by: (nater) on June 19, 2009, 07:49:56 AM
this works best wile you are in program

code "g90"

ChX = GetUserDRO( 1200 )
ChY = GetUserDRO( 1201 )
ChZ = GetUserDRO( 1202 )

Code "G53 G00 Z-0.1" 'Move the tool all the way up
Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-7 F10" 'Z move down untill hit
While IsMoving()
Wend
ZposOld = GetVar(2002) 'Get the Position that the Porbe hit at
Code "G53 G00 Z-0.1"'Z move all way up
While IsMoving()
Wend

MsgBox ("Insert the new tool")
MsgBox ("Ok to finish tool change")

Code "G53 G00 Z-0.1" 'Move the tool all the way up
Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-7 F10" 'Z move down untill hit
While IsMoving()
Wend
ZposNew = GetVar(2002) 'Get the Position that the Porbe hit at
Offs = ZposOld - ZposNew
Call setdro (2,&Offs)   'Set the value of the DRO to the value that is in "Offs"
Code "G53 G00 Z-0.1"   'or hoever high you want to go to get up safely off the probe
MsgBox ("Ok to return to program")

Code "G00 x0 y0"
Title: Re: Tool Height Touch Probe
Post by: (nater) on June 19, 2009, 07:51:34 AM
you copy and past this into your m6start. file and it will perform this through out your program perfectly the others dont seem to work so well