8671
General Mach Discussion / Re: Tool probe strange behavior.
« on: September 12, 2009, 05:09:32 AM »
Hi Sam,
This is the code I am using without any issues. It is very similar but with slight differences.
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentFeed = GetOemDRO(818) 'Get the current feedrate
DoOEMButton (1010) 'zero Z DRO
PlateThickness = 2.8 'Touch plate thickness is set here
ProbeFeed = 10 'Z axis feedrate is set here
If GetOemLed (825)=0 Then 'Check to see if plate is already grounded
Code "G31Z -15 F" &ProbeFeed 'Probing move at ProbeFeed rate
While IsMoving() 'Wait for Z move
Wend
Code "G4 P0 .25" 'Pause for DRO to update
ZProbePos = GetVar(2002) 'Exact point probe touches
Code "G0 Z" &ZProbePos 'Go back to exact point of touch if there was any overrun
While IsMoving () 'Wait for Z move
Wend
Call SetDro (2, PlateThickness) 'Set DRO to plate thickness
Code "G4 P0 .25" 'Pause for DRO to update.
Code "G0 Z5" 'Z retract height is set here
Code "(Z axis is now zeroed)" 'Message for status bar
Code "F" &CurrentFeed 'Reset original feedrate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'Message for status bar
End If
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
Tweakie.
This is the code I am using without any issues. It is very similar but with slight differences.
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentFeed = GetOemDRO(818) 'Get the current feedrate
DoOEMButton (1010) 'zero Z DRO
PlateThickness = 2.8 'Touch plate thickness is set here
ProbeFeed = 10 'Z axis feedrate is set here
If GetOemLed (825)=0 Then 'Check to see if plate is already grounded
Code "G31Z -15 F" &ProbeFeed 'Probing move at ProbeFeed rate
While IsMoving() 'Wait for Z move
Wend
Code "G4 P0 .25" 'Pause for DRO to update
ZProbePos = GetVar(2002) 'Exact point probe touches
Code "G0 Z" &ZProbePos 'Go back to exact point of touch if there was any overrun
While IsMoving () 'Wait for Z move
Wend
Call SetDro (2, PlateThickness) 'Set DRO to plate thickness
Code "G4 P0 .25" 'Pause for DRO to update.
Code "G0 Z5" 'Z retract height is set here
Code "(Z axis is now zeroed)" 'Message for status bar
Code "F" &CurrentFeed 'Reset original feedrate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'Message for status bar
End If
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
Tweakie.