What's new
What's new

Part Zeroing and Macros

megbers

Aluminum
Joined
Apr 19, 2007
Location
San Antonio
When trying to find the center of a rectangular part, I touch off the top, bottom, left and right and use the machine coordinates to determine the center of the part. I would like to be able to use "part zero set" and set the t,b,l,r values into a vacant work coordinate system (say g110 and g111) and have a program determine the center and put that into my g54 coordinates. Is this possible? If so, I would appreciate some help writing said program. Thanks!
 
megbers:

I assume you use a round something, maybe an edge finder, with near zero runout, or always use the same side of the something to do "touch off" to manually determine an edge.

Write five programs --- one each for left, right, rear, front, and calculate G5x. Touch one side and run its program, and repeat for each side. After all four sides are done run calculate.

Assign two variables for each axis, for example:
#500 is left X axis,
#501 is right X axis,
#502 is rear Y axis.
#503 is front Y axis.

Your programs could be O1001 for left, O1002 for right, etc, and O1000 for calculate. Note if you always made "front Y" the last program, then "calculate G5x" could be included in "front Y".

Program "left" would write the current X value of the machine into #500, and "right" the current X value into #501. Similarly for "front" and "rear".

"calculate" calculates the average of #500 and #501 and inserts this into the variable for X of G5x, and average of #502 and #503 into variable for Y of G5x, and you are done. You have to determine the correct signs and I leave the details to you.

.
 
Last edited:








 
Back
Top