Hello Guest it is March 29, 2024, 05:25:14 AM

Author Topic: autotoolzero  (Read 4919 times)

0 Members and 1 Guest are viewing this topic.

Offline PCH

*
  •  80 80
    • View Profile
autotoolzero
« on: February 24, 2021, 02:41:50 PM »
I know my vb script is good.  I have changed out a gecko servo drive and now my z axis is not traveling down to touch plate even though I have 4" of travel.  I goes down various depths but will not go down to touch plate. It does retract to the designated height though.  Not sure what to do.  Any help is appreciated.

Offline ZASto

*
  •  423 423
    • View Profile
Re: autotoolzero
« Reply #1 on: February 25, 2021, 02:55:34 AM »
So, show us your script. Maybe it is not quite good.
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.

Offline PCH

*
  •  80 80
    • View Profile
Re: autotoolzero
« Reply #2 on: February 25, 2021, 12:51:15 PM »
Here is my VB script:
It was working fine before I changed out my drive and now it will not go down to touch plate.   Stops a various depths


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 PCH

*
  •  80 80
    • View Profile
Autozerotool
« Reply #3 on: February 25, 2021, 08:54:55 PM »
My z axis is just retracting to set height.  It will not go down to touchplate.  My VB file is set to travel 4" before it gives up.  When I go to diagnostics and clip on line to router before initiate the zero button the digitizer flashes on intermitently.  .I do not think this should be happening.   Any suggestions would be great.  I am out of options.  Please help

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Autozerotool
« Reply #4 on: February 25, 2021, 09:57:38 PM »
Is this a new set up and macro or an old one that is now failing.
Without engineers the world stops

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: autotoolzero
« Reply #5 on: February 25, 2021, 10:12:40 PM »
The way the script is written it uses G90 G31 so if you have offsets or have changed the z datum point the 4" move is relative to that. Also if a tool offset is active with a height offset not equal to zero that can also change the distance.

In most cases probing is done in G91 moves.
Without engineers the world stops

Offline PCH

*
  •  80 80
    • View Profile
Re: Autozerotool
« Reply #6 on: February 26, 2021, 06:59:05 AM »
Well it a new gecko 30x servo drive.  A newer version of the one I replaced.  And it is the VB script I have used all along which worked great until now.
Here is the script:
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 PCH

*
  •  80 80
    • View Profile
Re: autotoolzero
« Reply #7 on: February 26, 2021, 07:02:03 AM »
So if I change the G90 to G91 in script that would do it?
Code "G90 G31Z-4. F4" 'probing move, can set the feed rate here as well as how far to move

Offline PCH

*
  •  80 80
    • View Profile
Re: autotoolzero
« Reply #8 on: February 26, 2021, 07:13:44 AM »
where would the z datum be that I would have inadvertently changed.

Offline PCH

*
  •  80 80
    • View Profile
Re: autotoolzero
« Reply #9 on: February 26, 2021, 07:14:58 AM »
also...thanks for getting back to me.