Hello Guest it is April 19, 2024, 10:34:37 PM

Author Topic: Tool zeroing macro help  (Read 25854 times)

0 Members and 1 Guest are viewing this topic.

Re: Tool zeroing macro help
« Reply #30 on: September 23, 2014, 06:25:35 AM »
isn't this the retract ?
but i don't understand the #2. is that SetVar(2 , .75) set at start?

SetOEMDRO (802,PlateThickness) 'Set Z-Axis DRO to Touch Plate thickness
Code "G0 Z #2" 'Retract off Touch Plate to the set height     <-------------------
While IsMoving () 'Wait until task has been completed
Wend
Kenneth

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Tool zeroing macro help
« Reply #31 on: September 23, 2014, 06:34:03 AM »
I use to use a code without a retract it always had problems.

i use one that includes a retract distance I have been using it for 3 years never had a problem.

I will find it a post it

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Tool zeroing macro help
« Reply #32 on: September 23, 2014, 06:40:26 AM »
Code: [Select]
this is the code I use



[codeRem Auto Tool Zero Z- Metric Version

DownStroke = -25 'Set the down stroke to find probe
DownFeedRate = 100 'Set the down FeedRate
RetractStroke = 10 'Set the retract Stroke
RetractFeedRate = 300 'Set the retract FeedRate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31 Z" &DownStroke &" F" &DownFeedRate 'probing move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
If Abs(ZprobePos) <= Abs(DownStroke)-0.1 Then 'Check if the probe has been found
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G1 Z" &PlateThickness + RetractStroke &" F" &RetractFeedRate 'retract
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "G0 Z0" 'retract to start pos
While IsMoving ()
Wend
Code "(Z-Plate not found, check connection or stroke and try again)" 'puts this message in the status bar
End If
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
End If
Code "F" &CurrentFeed 'Returns to prior feed rate
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
Exit Sub ]
Re: Tool zeroing macro help
« Reply #33 on: September 23, 2014, 06:52:07 AM »
Thanks Daniel, i'll try both when i get my electricity :)
Kenneth
Re: Tool zeroing macro help
« Reply #34 on: September 23, 2014, 07:42:23 AM »
Daniel, what's the UserDRO(1151) ? is this where i set probe height ?
Thanks
Kenneth

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Tool zeroing macro help
« Reply #35 on: September 23, 2014, 04:59:20 PM »
yep the code was from a screen someone else made I just got a copy of it. the blue probing screen I use has that dro number if you don't have that dro you will need to add it
Re: Tool zeroing macro help
« Reply #36 on: September 24, 2014, 05:42:46 AM »
John, what's the SetVar 1 and 2 ? can't see where they are used.
and in sim mode, it goes pass the max distant without warning.
maybe it needs a signal to work :)
Thanks

SetVar (1, -1) 'Maximum probing distance is set here
SetVar (2, .75) 'Retract height is set here
Kenneth

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Tool zeroing macro help
« Reply #37 on: September 24, 2014, 06:33:31 AM »

SetVar (1, -1) 'Maximum probing distance is set here
SetVar (2, .75) 'Retract height is set here

first one how far to go down
second one how far to go back up
Re: Tool zeroing macro help
« Reply #38 on: September 24, 2014, 06:47:08 AM »
Thanks Daniel,
i know WHAT they are, but don't see WHERE they're used.
Kenneth

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Tool zeroing macro help
« Reply #39 on: September 24, 2014, 06:52:08 AM »
you would have to look up what SetVar 1 and 2 is in the vb script manual