Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: edgas10 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
-
Post the script you are using and we will have a look at it.
Greg
-
hi thanks for the aswer.
but i don´t really know whats a scrip can you help me a litlle more ?
thanks
-
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
-
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
-
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
-
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
-
hi thanks for the help but i dont know how to put this code working !
regards edgar
-
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
-
i´m a litle bit confused here !
we got 00,0000 in the dro so , the first two zeros are centimeters right?
-
I'm sorry, I left the first few lines out that are critical. ::) Please paste this in and see how it does.
Brett
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness =0.059
ProbeFeed = 5
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