Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started 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.
-
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
-
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
-
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
-
Thanks SCOTT, I believe I have a use for that one also (;-) TP
-
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"
-
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