Hello Guest it is March 28, 2024, 10:11:27 PM

Author Topic: Auto zero tool for unsupported G31 boards  (Read 2124 times)

0 Members and 1 Guest are viewing this topic.

Auto zero tool for unsupported G31 boards
« on: March 03, 2016, 01:07:46 PM »
Leave here this macro or script for the boards that the code G31 does not work properly.

Z Auto zero tool - This is when you have a dro to adjust the height of the touchplate if not eliminate the necessary lines and set up the height in the code.
------------------------------------------
PT = GetOEMDro(1009)
If GetOemLed(825)=0 Then
Code "G91 G1 F20 Z-100"
While GetOemLed(825)=0
Wend
DoOEMButton (1003)
Sleep 500
SetDro (2,PT)
Sleep 1000
Code "G90 G1 F600 Z50"
While IsMoving()
Wend
Message( "Z axis is now zeroed" )
Else
Message( "Check if plate is grounded and try again" )
End If
End
------------------------------------------
This is to find the center of a circle or rectangle. I have not tried yet but it's something, take caution.
------------------------------------------
If GetOemLed(825)=0 Then
XN=GetOemDro(800)
Sleep 1000
Code "G91 G1 F30 X100"
While GetOemLed(825)=0
Wend
DoOEMButton (1003)
Sleep 1000
X1=GetOemDro(800)
Sleep 1000
Code "G90 G1 F300 X" &XN
While IsMoving()
Wend
Sleep 500
Code "G91 G1 F30 X-100"
While GetOemLed(825)=0
Wend
DoOEMButton (1003)
Sleep 1000
X2=GetOemDro(800)
XC=(X1+X2)/2
Sleep 1000
Code "G90 G1 F300 X" &XC
While IsMoving()
Wend
Sleep 500
YN=GetOemDro(801)
Sleep 1000
Code "G91 G1 F30 Y100"
While GetOemLed(825)=0
Wend
DoOEMButton (1003)
Sleep 1000
Y1=GetOemDro(801)
Sleep 1000
Code "G90 G1 F300 Y" &YN
While IsMoving()
Wend
Sleep 500
Code "G91 G1 F30 Y-100"
While GetOemLed(825)=0
Wend
DoOEMButton (1003)
Sleep 1000
Y2=GetOemDro(801)
YC=(Y1+Y2)/2
Sleep 1000
Code "G90 G1 F300 Y" &YC
While IsMoving()
Wend
Message( "Axis is now centered" )
Else
Message( "Check if plate is grounded and try again" )
End If
End