Hello Guest it is August 15, 2020, 05:14:43 AM

Author Topic: Please help auto tool zero not working--  (Read 1904 times)

0 Members and 1 Guest are viewing this topic.

Please help auto tool zero not working--
« on: September 27, 2013, 01:42:48 PM »
What am I doing wrong? I use the auto tool zero macro and it sets the tool height to zero.

BUT then when I go to cut it either is off too high or too low and it isn't at zero where it should be.
I just ruined a box I was making, please help me figure this out??

Do you have to regen the toolpath or that have nothing to do with it? Sometimes i do and it still doesn't work.

Here is my script....

CurrentAbsInc = GetOemLED (48) 'Copy current G90/G91 state
CurrentGMode = GetOemDRO (819) 'Copy current G0/G1 state
CurrentFeed = GetOemDRO (818) 'Copy current feedrate
Contact = 0 'Clear the contact flag
PlateThickness = 1.560 'Touch Plate thickness is set here
ProbeFeed = 80'Probing feedrate is set here
SetVar (1, -20) 'Maximum probing distance is set here
SetVar (2, 5) 'Retract height is set here
Code "M5" 'Ensures spindle is not running
Code G21 'Ensure metric units are used
Zs = GetOemDRO (61) 'Copy current Z-Scale DRO
Call SetOemDRO (61,1) 'Set Z-Scale DRO to 1
Label1: 'Entry point for Retry
DoOemButton (1010) 'Zero Z-Axis DRO
Code "(Setting Tool Zero)" 'Message for status bar
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = 0 Then 'Check to see if touch plate is already grounded
Code "G90 G31 Z #1 F" & ProbeFeed 'Probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
DoOemButton (1003) 'Clear a possible feed-hold condition
ProbePos = GetVar (2002) 'Exact point probe touched
Code "G0 Z" & ProbePos 'Go back to exact point of touch if there was any overrun
While IsMoving () 'Wait until task has been completed
Wend
Call SetDRO (2,PlateThickness) 'Set Z-Axis DRO to Touch Plate thickness
Code "G0 Z #2" 'Retract off Touch Plate the set distance
While IsMoving () 'Wait until task has been completed
Wend
Code "(Z-Axis is now Zeroed.)" 'Message for status bar
Code "F" & CurrentFeed 'Restore feedrate to original setting
If Contact = 0 Then 'Probe reached max travel without touching
Code "(ERROR - Probe did not touch.)" 'Message for status bar
Response = MsgBox ("ERROR - Probe did not touch.",37,"Auto Tool Zero")
If (Response = 4) Then 'User chose Retry
GoTo Label1 'Retry Probing routine
End If
End If
Else
Code "(ERROR - Touch Plate is grounded.)" 'Message for status bar
Response = MsgBox ("ERROR - Touch Plate is grounded - Check connection.",16,"Auto Tool Zero")
End If
Call SetOemDRO (61,Zs) 'Restore Z-Scale DRO to original setting
If CurrentAbsInc = 0 Then 'If G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'If G0 was in effect before then return to it
Code "G0"
End If

Thanks....