What's new
What's new

Fanuc macro programming

Teps71

Aluminum
Joined
Aug 4, 2003
Location
Sidney, OH
I have a Milltronics Cent 6 which is compatible with Fanuc. The question I have is, is there a way to setup a macro for facing off parts to length. In other words, I have stock which I saw cut to ~ 0.050" oversize. Then I face the ends to length, first facing .025" off one end, then .025" off the other. What I would like to do is edge find my work stop, then move over the desired length plus half the tool diameter. Then add another .010" to sneak up to the exact length, measuring the part and adjusting the Zero. Zero would be in the middle of the part on Y. The macro would allow the operator to input the width of the part on Y. Everything is accomplished in 2-axis mode.

Is it possible to do this in G-Code? Currently I write programs in conversational and have a program for each size of stock.
 
The easiest way is to use a variable to adjust the finish Y coordinate. Lets say your Y coordinate is 4.125

Y[4.125+#501]

The operator can then put the adjustment amount into variable 501.

Or, if you don't want him doing any fancy math...

Let's assume half the end mill is .375 so, 4.125-.375= 3.75

We also need to set some limit as to the value the operator can set. Let's make it no more than .050"

Position to Y[3.76+.375] and mill. Then program:

M01;
(Input measured length into #500);

IF [#500 GT 3.75] GOTO 200
#3000=1(The part is too short);
N200#501=3.75-#500;
IF[#501GT-.05] GOTO500
#3000=2(Part is too long)
N500 M03 S4000;
G0 Y[4.125+#501]
G01 X F (to mill to length)
 
Any time.

I forgot to mention that this will work on a Fanuc. I've never worked on a Centroid, so you may need to adjust the variable numbers and/or syntax if it's not 100% Fanuc compatible.
 








 
Back
Top