Page 1 of 1

auto zero tool problem

Posted: Fri Apr 03, 2015 12:55 pm
by kiark82
Hi there.

Since working with different tools is fun i had to get a zero probe to get rid of all the inaccuracies when changing tools manually.

I have the hardware and the pins set up and got to the part with the script. Im using this one from instructables:

'VB Code Start
'-------------------
CurrentFeed = GetOemDRO(818)
DoSpinStop()

ZMove = 20.00 'Total lenght of Probe to move before Stop or no Contact Made.
ZOffset = 1.60 ' Plate Hight
ZSal = ZOffset + 2.00 '+ Free Hight, Will possition the Proble 2 MM over the Material.

StopZmove = 0
If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G4 P2.5"
Code "G31 Z-"& ZMove & "F25"
While IsMoving()
Sleep(200)
Wend
Probepos = GetVar(2002)
If Probepos = - ZMove Then
responce = MsgBox ("**ERROR** " , 4 , "Probe **ERROR**" )
Code "G0 Z10"
StopZmove = 1
Code "F" &CurrentFeed
End If
If StopZmove = 0 Then
Code "G0 Z" & Probepos
While IsMoving ()
Sleep (200)
Wend
Call SetDro (2, ZOffset)
Code "G4 P1"
Code "G0 Z" & ZSal
Code "(Z zeroed)"
Code "F" &CurrentFeed
End If
Else
Code "(Check Ground Probe)"
End If
Exit Sub
'-------------------
'VB Code Stop

Unfortunately there is some issue with the zaxis movement. It jogs down till it makes contact but instead of going back up it runs deeper for about 2-3 mm. I didnt change anything but the probe height which is 2.5 mm in my case. Am i missing something or are there some general config options that need to be un/checked?

Thanks,

kiark

Re: auto zero tool problem

Posted: Fri Apr 03, 2015 1:55 pm
by WillAdams
I wish I could help, but I'm afraid that I'm mystified by what you've written, and totally lack a context to understand it, and it doesn't seem to've been discussed here, or at least not in this fashion.

Would you mind sharing the details of:

- what changes you've made to your machine
- what tool you're using to run this code
- the link for the code (and its license?)

maybe that'll make it easier for someone who actually understands what you're doing to help you.

Re: auto zero tool problem

Posted: Fri Apr 03, 2015 2:41 pm
by cvoinescu
GRBL now supports probe commands -- why fake it in Visual Basic when GRBL can do it natively?

Also, your code is hard to read without indentation. Use the

Code: Select all

 BBCode element.

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 2:30 am
by DanMc
OP is using a button script in Mach3, that's why it's in VB.

I don't know why your probe keeps diving after contact but it seems like it has to do with the thickness of the touchplate, like its retracting the right distance but the wrong direction. Is this the actual code you are using (after you modified the touchplate height)?

I use different script that I found on the Mach forum which I found a little easier to understand for me, not having a programming background.

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 7:20 pm
by kiark82
sorry for my bad explanation, basically i was doing this:

http://www.instructables.com/id/Mach3-Z ... l/?lang=de

as DanMc stated i'm using mach3 and therefore i have to use that VB script.

i also tried to alter the numbers with + und - to make it retract up, but it didnt work. now im using this script:

Code: Select all

Message( "Auto Zeroing..." ) 
If IsSuchSignal (22) Then
Call SetDRO( 2, 0.00 ) 
code "G31 Z-20.00 F25"
While IsMoving()
Wend
Call SetDRO( 2, 2.50 ) 
code "G1 Z2"
End If
it works most of the time, but after completing one pass i have to restart mach3 or it also retracts into the false direction again :(

@DanMc: could you show me what code you are using currently?

Thanks,

kiark

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 7:46 pm
by cvoinescu
My bad, I did not notice the section. And just a week or two ago I scolded someone else for doing exactly the same thing. I am annoyed with myself. :)

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 8:42 pm
by Damin69
I had a similar issue but mine would go down about a 1/4" then retract up. I am useing a c10 Bob I ended up putting a small cap in parallel with the input on the board cleared the issue right up.

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 11:13 pm
by DanMc
This is the code I am using:

Code: Select all

ZDRO = 2
PlateThickness = getOEMDRO(1001)
RetractClearance = 5
Message( "Auto Zeroing..." ) 
If IsSuchSignal (22) Then
code "G31 z-10 F20"
While IsMoving()
Wend
Call SetDRO( ZDRO,6.35)
RetractHeight = RetractClearance + PlateThickness
code "F200"
code "G1 Z"& RetractHeight
End If   
Message( "Z Axis Zeroed" ) 
Note that this is in metric and my touchplate measures 6.35, you would need to change that to whatever yours measures.
Also note that it won't work if your current Z position is more than 10mm above the touchplate.
It's pretty much the same as the second one you posted, just annotated a littler better

Re: auto zero tool problem

Posted: Sat Apr 04, 2015 11:20 pm
by Damin69
Here is the code I am using on mine. It is in imperial units.

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, .060) ' 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

Re: auto zero tool problem

Posted: Mon Apr 06, 2015 6:24 pm
by kiark82
thanks! i will try these codes tomorrow