Hello Guest it is April 03, 2020, 03:25:32 AM

Author Topic: auto zero and touch plate  (Read 7110 times)

0 Members and 1 Guest are viewing this topic.

auto zero and touch plate
« on: September 15, 2009, 06:04:40 PM »
hi im from portugal  and i have a few questions about this auto zero .
i´´ve already got the plate and its well conected to the software, but

wen i hit the auto zero button the z comes down touch the plate goes up ,stop and then goes up to the
top .

i use mm  can somebody help me with this?

how do i program  this feature ?

thanks Edgar

Offline Greolt

*
  •  956 956
    • View Profile
Re: auto zero and touch plate
« Reply #1 on: September 15, 2009, 07:49:09 PM »
Post the script you are using and we will have a look at it.

Greg
Re: auto zero and touch plate
« Reply #2 on: September 16, 2009, 03:41:59 AM »
hi thanks for the aswer.
but  i don´t really know whats a scrip can you help me a litlle more ?
thanks

Offline Greolt

*
  •  956 956
    • View Profile
Re: auto zero and touch plate
« Reply #3 on: September 16, 2009, 03:50:08 AM »
OK what "auto tool zero" button are you using?

Where did you get it?  Is it a screenset that you downloaded from somewhere?

If it has an on-screen button that you press to get the action you described then do this,

Go to menu / operator / edit button script, and the button will start to wink.

Click the button and the VB editor will pop up showing the script.

Copy that script and post it here.

Greg
Re: auto zero and touch plate
« Reply #4 on: September 17, 2009, 03:53:50 PM »
 
i i´ve downloaded the screen from greolt (touch.set) .
i´m using the auto zero buton that is right in the midle of the screen in the bottom.
i did the edit button  and :

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
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

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 P2" ' this delay gives me time to get from computer to hold probe in place

Code "G90 G31 Z-20 F100" '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 axact 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, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness

Code "G4 P0.25" 'Pause for Dro to update.

Code "G1 Z20 F800" 'put the Z retract height you want here

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 aplicable

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

Exit Sub 

thanks edgar

Offline Greolt

*
  •  956 956
    • View Profile
Re: auto zero and touch plate
« Reply #5 on: September 17, 2009, 05:05:58 PM »

wen i hit the auto zero button the z comes down touch the plate goes up ,stop and then goes up to the
top .


I am not really sure what you are seeing.

Code "G90 G31 Z-20 F100" 'probing move, can set the feed rate here as well as how far to move

This line is where the Z will move down till it touches the plate.   It is set at 20mm so it will only go that far then stop.  So you must start less than 20mm from the plate.

Code "G1 Z20 F800" 'put the Z retract height you want here

This line is where the Z will retract to a height of 20mm when it is finished.  An absolute height, not incremental.    Note this presumes your plate is less than 20mm thick.

You can open the VB editor and step through the script one line at a time.  This will show where it is not doing what you are expecting.

Greg

Offline Chaoticone

*
  • *
  •  5,629 5,629
  • Precision Chaos
    • View Profile
Re: auto zero and touch plate
« Reply #6 on: September 17, 2009, 10:14:03 PM »
I have been working on an issue with my tool touch off routine and just got it straight. This was a macro I had been using for a couple of years already. I have been doing some testing and some where along the line it got broke. The problem was simple. The VB in Mach is running faster now so the sleep command is a necessity in many cases now. I have been aware of this for a good while now but the tunnel vision got me good this time.  ::) Can you paste this code in your button for a test for me?  Let me know if this works for you.

Brett

      'Auto tool touch off button script
Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P2" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
Code "G4 P0.25"
While IsMoving()
Sleep(100)
Wend
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Sleep(100)
Wend
Call SetDro (2, PlateThickness)
Sleep(100)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z0.25" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: auto zero and touch plate
« Reply #7 on: September 18, 2009, 04:25:19 AM »
hi thanks for the help but i dont know how to put this code working !
regards edgar

Offline Chaoticone

*
  • *
  •  5,629 5,629
  • Precision Chaos
    • View Profile
Re: auto zero and touch plate
« Reply #8 on: September 18, 2009, 06:35:15 PM »
With Mach open click on operator button at the top of the screen and then "edit button script". The button will begin to blink. Click on it and the VB button editor will open. Paste the code from my last post in and save. Then close the vb editor.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: auto zero and touch plate
« Reply #9 on: September 19, 2009, 07:40:21 AM »
i´m a litle bit confused here !

we got 00,0000 in the dro so , the first two zeros are centimeters right?