Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: TOMMYD on August 30, 2011, 05:26:36 PM
-
I am setting up my auto tool zero button and got the code from the forum but don't know how to modify to my specs. I obviously don't know anything about writing codes.
for example;
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
?should this read?
? PlateThickness = .375 'Z-plate thickness DRO ?
OR
? PlateThickness = .375(1151) 'Z-plate thickness DRO ?
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
? Is this my machine zero,can I jog close to plate ?
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
? what distance does .75 represent ?
Code "G31Z-.75 F10" '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
? should I enter plate thickness here or does it know from line 1 ?
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.
? is this set for 1" now?
Code "G0 Z1." 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
End If
Thanks,Tommy
-
Plate thickness is taken from a User defined DRO on the screen. If your plate is .375, you can code it without using the DRO like this:
PlateThickness =0.375
? Is this my machine zero,can I jog close to plate ?
No, it zero's the Z axis in the current coordinate system.
? what distance does .75 represent ?
The maximum travel of the Z axis during probing. If you want to start the macro at a location higher than 0.75, you'll want to increase this number. Note that it's negative, -0.75.
? should I enter plate thickness here or does it know from line 1 ?
It's assigned in Line one. "PlateThickness" is a variable, and you're assigning it the value of 0.375
? is this set for 1" now?
Yes, it's set to retract 1"
I seriously recommend using a more robust macro for your auto zero. The minimal one you're showing here is open to a lot of possible errors, which can cause broken tols or even machine damage.
You might want to look here for a much more refined version.
http://www.cnczone.com/forums/cnc_wood_router_project_log/36099-another_aussie_auto_tool_zero.html
-
Gerry,
Thanks for the quick responce.I'll use the one you suggested,but I'll probably still be back with questions. Thanks Again ,Tommy
-
Gerry, It worked flawlessly the 1st time.Now all I need is to learn how to put an LED next to the auto tool zero button so I can test without going to diagnostics page. Thanks,Tommy
-
If you post your .set file I can do it for you.
-
Thanks for the offer! I would like to try it myself.If it flops I'll be back. Thanks,Tommy
-
Be sure to make a backup copy first. :)