What's new
What's new

Bar pull cycle for Fanuc?

wheelieking71

Diamond
Joined
Jan 2, 2013
Location
Gilbert, AZ
In a time crunch, and don't really have time to try and decipher the Fanuc manual.
I mean I will if I have to, but......

Can anybody hook me up with simple bar-pull basics for a Fanuc 18i-T? Just a simple loop is all I am trying to accomplish.

This:

%
O?????
(PROGRAM NAME - ?????)
M97 P100 L??
M30
(TOOL - 1 OFFSET - 1)
(OD ROUGH RIGHT - 80 DEG. INSERT - CNMG-431)
G20 N100
G0 T0101
(CODE FOR FIRST CYCLE)
G28 U0. W0. M05
T0100
M01
(TOOL - ? OFFSET - ?)
(BAR PULLER)
G00 T?0?
M05
G98 G00 G54 X?. Z0.
G01 X0. F80.
M11
G04 P0.3
W?.?
M10
G04 P0.3
X?.
G00 G28 U0. W0. M05
M99
M01
%

Is how I would do it in a HAAS. But, I don't own a HAAS. And, this new Fanuc machine is totally greek to me so far.
Just trying to save some time. As, I have wasted 2 weeks getting this thing in here, and now its crunch time.
 
Your main prog and sub must be two different programs.

O?????
(PROGRAM NAME - ?????)
M98 P(#of repeats, 2 digit min)(prog number)
M30

Here's how they are written for my O&H's 18T control:

O1000
M98 P081111 (8 loops of program O1111)
M30

Programs O1000 and O1111 need to be 2 separate programs in memory.

Did you bar pull with your Nak?
 
Last edited:
Yes, I did pull bar in the NAK.
And, it took me quite some time to figure out how to make a loop work. (Hence the reason for this thread. flashbacks of how long it took me to figure the NAK out!)
Here is how I ended up making it work:

<IN SUB PROGRAM (which contains all code except the loop!)>
O0002
( PULL BAR )
G28 U0.0 W0.0
G50 X0. Z0.
T0?00 (BAR PULLER )
G98
G00 X3.0 Z0.0 T0?0?
G01 X0.0 F80.
M11
G04 P1500
G01 Z?.?
M10
G04 P1500
G01 X3.0
G28 U0.0 W0.0
G00 T0?00
M99
%

<THIS !IS! THE MAIN PROGRAM (this is the active program for pressing cycle-start)>
O0001
M98 P0002 L1
M30


Soo, from the looks of what you posted, a loop cycle in the 18i-T is more similar to the NAK, than my HAAS example.

It looks like "P" performs double duty? (both P and L)
 
Some of the newer Fanucs (at least was on ~2005ish 0T) have mode for repeating the program. It's on the mode switch betveen Mem and Edit if i remember correctly. Just set up required part amount on the setting page, it'll stop after the counter reaches the required number. Part counting M-code might be required, but usually not.

On the older Fanucs, you'll have to use the subprogram routine. Would work on new ones too, but i've preferred the other method, with the bar puller program within the main program.
 
Yes, I did pull bar in the NAK.
And, it took me quite some time to figure out how to make a loop work. (Hence the reason for this thread. flashbacks of how long it took me to figure the NAK out!)
Here is how I ended up making it work:

<IN SUB PROGRAM (which contains all code except the loop!)>
O0002
( PULL BAR )
G28 U0.0 W0.0
G50 X0. Z0.
T0?00 (BAR PULLER )
G98
G00 X3.0 Z0.0 T0?0?
G01 X0.0 F80.
M11
G04 P1500
G01 Z?.?
M10
G04 P1500
G01 X3.0
G28 U0.0 W0.0
G00 T0?00
M99
%

<THIS !IS! THE MAIN PROGRAM (this is the active program for pressing cycle-start)>
O0001
M98 P0002 L1
M30


Soo, from the looks of what you posted, a loop cycle in the 18i-T is more similar to the NAK, than my HAAS example.

It looks like "P" performs double duty? (both P and L)

That's weird.

When I started bar pulling, my 18T's would not recognize the L so I have to write as P081111, for them to loop.

Figgerd your machine would be the same:confused:.
 
That sample (for the NAK) is for the 6T. Quite a different beast that the 18

The OH 18i control has WAY more in common with the 6T than any Haas. The biggest difference from the NAK is tool wear offsets and work shift, along with the combined page layout of program and position. The rest is pretty much the same.
 
wheelie,

This may not be the proper way of doing things as I know squat about CNC lathes - still cutting my teeth, but this is on a Fanuc 18T:

%
O0001
N1 ( 10625 X 5312 X 7500 REV 1.NC )
N2 ( OKUMA ACT20 FANUC 18T )
N3 ( MON. 09/01/2014 )
N4 ( 12:17PM )


N5 G99 G80 G40 G20
N6 G10 P0 X0.Z-3.5
N7 G00 G28 U0. W0.
N8 (TOOL #6 BAR PULLER)
N9 (TO BE USED AS A WORK STOP)
N10 G97 S1500 T0606
N11 G50 S1500
N12 M11 (OPEN CHUCK)
N13 G00 X-3.125 Z.25
N14 M01
N15 (OPERATOR - POSITION BAR AGAINST BAR FEEDER)
N16 M10 (CLOSE CHUCK)
N17 G00 Z2.
N18 G00 G28 U0. W0.
N19 (TOOL #2 .163 WIDE CUTOFF )
N20 G97 S1500 T0202 M04
N21 G50 S1500
N22 G00 X1.325 Z0.
N23 G01 X-.25 F.010
N24 G00 Z.5
N25 T0200
N26 G00 G28 U0. W0.


N27 (TOOL #7 #4 CENTER DRILL *P*)
N28 G97 T0707
N29 G50 S1500
N30 G97 S450 M03
N31 G00 X0. Z.1
N32 G74 R.1
N33 G74 X0. Z-.3 P0 Q5000 R0. F.015
N34 M09
N35 G97
N36 G00 Z2.
N37 T0700

.
.
.
.
.
.

N87 (TOOL #6 BAR PULLER)
N88 M05
N89 G98 T0606
N90 G00 Z-1.125
N91 X2.
N92 G01 X0. F100. M34
N93 M11 (OPEN CHUCK)
N94 Z-.216
N95 M10 (CLOSE CHUCK)
N96 X3. M35
N97 G99 T0600
N98 G28 U0. W0.
/N99 M30
N100 M99 P27 (LOOP BACK TO N27)
%

When first starting the program there is nothing in the spindle. I hit the go button and the turret puts the bar puller in front of the chuck and the chuck opens. I stick a piece of material in the spindle (nylon in this case), thru the chuck, and against the bar puller. Hit the go button again and let the big dog eat.

My counter doesn't stop the machine, however. Don't know why that is, but I get an alarm when the parts counter reaches preset.

Hope this helps.
 
The OH 18i control has WAY more in common with the 6T than any Haas. The biggest difference from the NAK is tool wear offsets and work shift, along with the combined page layout of program and position. The rest is pretty much the same.

Don't forget about the stupid G50......You know, the one that has nothing to do with spindle speed.
 
Don't forget about the stupid G50......You know, the one that has nothing to do with spindle speed.

Exactly. :ack2:

The newer controllers are usually backward compatible to what worked on the older machines so they didn't have to teach the old dogs new tricks if they were too old to learn. ;)
 
Some of the newer Fanucs (at least was on ~2005ish 0T) have mode for repeating the program. It's on the mode switch betveen Mem and Edit if i remember correctly. Just set up required part amount on the setting page, it'll stop after the counter reaches the required number. Part counting M-code might be required, but usually not.

Everything mentioned here is machine tool builder specific.
 
Hello wheelieking71,
If your control is an "i" version, by setting parameter bit 6005.0 to 1 enables Subprogram call by Sequence Number. In this case the Subprograms can be included in the one, main program after M30.

To call the Subprogram, M98 is used preceding a "Q" address that specifies the Sequence Number of the start of the Subprogram. For example, M98 Q100 will call the Subprogram starting at Sequence Number N100.

This feature can also be used to commence at a particular Sequence number in an external Sub Program.
For example:
M98 P1000 Q20
The above code will have the program start at sequence number N20 when control branches to the external Sub O1000. An "L" address can be added to the call block to have the sequence repeated "L" number of times.

Regards,

Bill
 
Hello wheelieking71,
If your control is an "i" version, by setting parameter bit 6005.0 to 1 enables Subprogram call by Sequence Number. In this case the Subprograms can be included in the one, main program after M30.

To call the Subprogram, M98 is used preceding a "Q" address that specifies the Sequence Number of the start of the Subprogram. For example, M98 Q100 will call the Subprogram starting at Sequence Number N100.

This feature can also be used to commence at a particular Sequence number in an external Sub Program.
For example:
M98 P1000 Q20
The above code will have the program start at sequence number N20 when control branches to the external Sub O1000. An "L" address can be added to the call block to have the sequence repeated "L" number of times.

Regards,

Bill

Thanks for the info angelw!!
I owe you a big thank-you as well.
It seems every time I turn to google with a Fanuc question, there you are with a solution. On many different forums.
Your kind sharing of knowledge is greatly appreciated!
 
My Fanuc i series is:

M98 P1234 L2

I wish I could run local subroutines like my Haas with a M97.............................
 
My Fanuc i series is:

M98 P1234 L2

I wish I could run local subroutines like my Haas with a M97.............................

Hello David,
You can; see my Post #16. Instead of using M97 à la HAAS, M98 Q_ _ is used, where Q_ _ specifies the sequence number of the Local Subprogram.

Example

--------
--------
--------
M98 Q100
M98 Q110
M98 Q120
--------
--------
--------
--------
M30
N100
--------
--------
--------
--------
M99
N110
--------
--------
--------
--------
M99
N120
--------
--------
--------
--------
M99

In addition, the control can be directed to start at a specified sequence number in an External Subprogram.


Example

--------
--------
--------
M98 P1000 Q30
--------
--------
--------
M30

O1000
(External Subprogram)
N1 ---------
------------
------------
------------
------------
N10
------------
------------
------------
------------
N20
------------
------------
------------
------------
N30
------------
------------
------------
------------
M99

In the above example, Subprogram O1000 is called, starting at sequence number N30.

The fact that your machine uses M98 P1234 L2 format indicates that it may already have parameter bit 6005.0 set to 1 to enable Subprogram Call made by sequence number, or that the control is set to use FS15 Format.

Regards,

Bill
 
Hello David,
You can; see my Post #16. Instead of using M97 à la HAAS, M98 Q_ _ is used, where Q_ _ specifies the sequence number of the Local Subprogram.

Example

--------
--------
--------
M98 Q100
M98 Q110
M98 Q120
--------
--------
--------
--------
M30
N100
--------
--------
--------
--------
M99
N110
--------
--------
--------
--------
M99
N120
--------
--------
--------
--------
M99

In addition, the control can be directed to start at a specified sequence number in an External Subprogram.


Example

--------
--------
--------
M98 P1000 Q30
--------
--------
--------
M30

O1000
(External Subprogram)
N1 ---------
------------
------------
------------
------------
N10 <<<<<<<<<<<<<<<<< from here
------------
------------
------------
------------ <<<<<<<<<<<<<<<<< to here
N20
------------
------------
------------
------------
N30
------------
------------
------------
------------
M99

In the above example, Subprogram O1000 is called, starting at sequence number N30.

The fact that your machine uses M98 P1234 L2 format indicates that it may already have parameter bit 6005.0 set to 1 to enable Subprogram Call made by sequence number, or that the control is set to use FS15 Format.

Regards,

Bill


As it seems wheelie has his problem solved I don't feel too guilty hi-jacking his thread. :D

I have two noob questions, (please be 18T specific with your answers):

1) Regarding subprograms and citing the example above, how does one delineate the 'sections' of the subprogram in the example above? For instance, in the main program I want to call a portion of the sub that begins at N10, but I don't need to run anything after and including line N20. How does one terminate the section consisting of line N10 to the line prior to N20? Will each 'section' not require a unique program number?

2) How does one make the bar pulling routine I posted in post #8 a universal routine? Say I want to leave this subprogram in the control memory and I want to call it from different programs, but I need a different value for the length to be pulled. How does one pass a variable for this length from the mainline program to the subprogram?
 








 
Back
Top