
Originally Posted by
TCGliderguy
One thing that I have observed... In the text line of the Mach3 interface, after I attempt to zero the Z axis, and it drives the cutter downward after it contacts the touch pad...
I see a message that says "Error on line:213 Internal Error
Is this a clue?
Thanks!
From your previous email where you posted the code you are using:
Code:
Call SetOEMDRO (802, PlateThickness) ' Set the Z axis DRO to whatever is set as plate thickness
Code "G0 Z" & Retract ' Retract
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" ' Success!
End Sub
On my laptop I had the exact same issue as you except when I set the offset DRO to 0. I went into the code and narrowed it down to the time the touch was made, the Z DRO was updated, and the time the call to retract to the set height was given. I has to add the
Code:
While IsMoving ()
Wend
after the call to set the DRO
Here is my bare-bones z-button script for your consideration:
Code:
Rem VBScript To probe In the z axis
PlateOffset = GetUserDRO(1151) 'Get plate offset DRO
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
DoOEMButton(1010) 'Zero Z dro'
rem Code "G4 P5" 'Pause 1 seconds to give time to position probe plate
Code "F3" 'slow down feedrate to x ipm
Rem Probe In the z direction
Code "G31Z-1"
While IsMoving() 'wait for probe move to finish
Wend
ZProbe = GetVar(2002) 'read the touch point
Code "G0Z" &ZProbe 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
Call SetOEMDRO (802, PlateOffset) 'set the Z axis DRO to plate thickness
While IsMoving ()
Wend
Code "G0 Z0.25" 'put the Z retract height you want here
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
rem Code "G0 Z0.25"
Code "F" &CurrentFeed 'Returns to prior feed rate
End If
FWIW,
Jay