Hello Guest it is April 11, 2021, 09:49:41 PM

Author Topic: autotoolzero  (Read 563 times)

0 Members and 1 Guest are viewing this topic.

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: Autozerotool
« Reply #10 on: February 26, 2021, 08:33:57 AM »
but your new drive will drive 4" if youd do G91 Z-4 f10 for example in MDI Input
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline PCH

*
  •  79 79
    • View Profile
Re: autotoolzero
« Reply #11 on: February 27, 2021, 08:42:30 AM »
Will give this a try this morning

Offline PCH

*
  •  79 79
    • View Profile
Re: autotoolzero
« Reply #12 on: February 27, 2021, 10:03:10 AM »
Yes the string worked and the z axis went down 4".....how do I edit the VB script to initiate this downward movement..thank you

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: autotoolzero
« Reply #13 on: February 27, 2021, 10:41:56 AM »
Change:
Code: [Select]
  Code "G90 G31 Z-4. F4" 'probing move, can set the feed rate here as well as how far to move
to:
Code: [Select]
  Code "G91 G31 Z-4. F4" 'probing move, can set the feed rate here as well as how far to move
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline PCH

*
  •  79 79
    • View Profile
Re: autotoolzero
« Reply #14 on: February 27, 2021, 11:33:50 AM »
NOPE...STILL MOVES UPWARD WHEN I INITIATE THE AUTO ZERO TOOL...what can I try next
btw in diagnostics my digitizer led is flashing intermittently ....not sure why

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: autotoolzero
« Reply #15 on: February 27, 2021, 11:45:03 AM »
pls put this code at the beginning of your macro:

Code: [Select]
'probe already active ?
If GetOEMLed(825) Then
DoOEMButton(1003)
MsgBox "probe input activ",vbOK + vbCritical ,"error !"
End If

if a box with "probe input activ" is comming up you have to check your probe Input/wiring
« Last Edit: February 27, 2021, 11:46:38 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline PCH

*
  •  79 79
    • View Profile
Re: autotoolzero
« Reply #16 on: February 27, 2021, 02:41:19 PM »
getting script error message....how critical is the text with respect to spacing....can you put it in the script I posted so I know exactly where it goes.   thanks

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: autotoolzero
« Reply #17 on: February 28, 2021, 03:26:14 AM »
pls post your complete code.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline PCH

*
  •  79 79
    • View Profile
Re: autotoolzero
« Reply #18 on: February 28, 2021, 07:53:41 AM »
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

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 P3" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-4. F4" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, .250) ' change .060 to your plate thickness and then adjust for final accuracy
Sleep 200 'Pause for Dro to update.
Code "G1 Z1. F50" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
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   

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: autotoolzero
« Reply #19 on: February 28, 2021, 10:07:40 AM »
this code is running here:

Code: [Select]
Sub Main()
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

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

Sleep(3000) ' this delay gives me time to get from computer to hold probe in place
Code "G31 Z-4. F4" ' probing move, can set the feed rate here as well as how far to move
While IsMoving() ' wait while it happens
Wend

ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos   'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend

Call SetDro (2, .250) ' change .060 to your plate thickness and then adjust for final accuracy
Sleep 200 ' Pause for Dro to update.
Code "G1 Z1. F50" ' put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend

Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Message "Z-Plate is grounded, check connection and try again" 'this goes in the status bar if applicable
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   
End Sub

and z-axis is going down.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.