Archive for September, 2017

The G66 is much more practical, there fore more of ten used

The G66 is much more practical, there fore more of ten used, than the G661 Compare the typical for mats for both, the G65 and the G66 com mands, us ing the fol low ing ex am ple:


Copyright 2005, Industrial Press Inc, New York, NY –


FANUC CNC Custom Macros


ASSIGNING VARIABLES


99


75


Figure 17


Drawing example for a modal macro call


M


cnc drilling Machine


X0Y0 is at the lower left corner,


5×05 T


Z0 is at the top of the 5mm plate


HRU


10


55


12


10


11


13


15


20


13


AL PLATE 75 x 55 x 5


The sim ple ex am ple uses a part draw ing in Fig ure 17, where four holes have to be tapped (drill –


ing op er a tion Busway Press Clamp Machine is omit ted in the ex am ple) The macro will be de signed for a spe cial tap ping op er a –


tion only and G84 tap ping cy cles can not be used This is also a good ex am ple of sum ming up the


sub jects cov ered so far


The main ob jec tive of the macro is to pro gram a lower feedrate when the tap moves into the ma –


te rial and custom processing machine a higher feedrate when the tap moves out This tap ping tech nique is use ful for very fine


threads in soft ma te ri als, to pre vent thread strip ping These are the pro gram ming ob jec tives:


o


Spin dle speed


850 r/min


o


Nominal feedrate


425 mm/min (850 r/min x 05 pitch)


o


Feedrate in


80% of the nom i nal feedrate cut ting in


o


Feedrate out


120% of the nom i nal feedrate cut ting out


o


Retract clearance


3 mm


o


Cutting depth


65 mm (15 mm below the bottom of part)


Se lec tion of Vari ables


Any as sign ment ad dress can be used in the G65 macro call, pro vid ing it meets the cri te ria of


mac ros Since let ters will be used as as sign ments, the macro pro gram mer has 21 of these let ters to


choose from It makes sense to se lect let ters that pro vide some re drilling tools la tion ship to their mean ing in the


macro From the list above, se lect ing ar gu ment F for feedrate, S for spin dle speed, Z for tap ping


depth, R for the ini tial and re tract clear ance, etc, makes it eas ier to fill in the as sign ments This is


only a teach ing macro that does n

(those not listed) will most likely in clude the can cel la tion of feedhold

 (those not listed) will most likely in clude the can cel la tion of feedhold,


feedrate over ride and the sin gle block mode, all for a more re li able ex e cu tion of the pro gram


blocks All of them can be con trolled copper busbar bending machine by a macro, us ing sys tem cnc cutter vari ables and other features, de –


scribed else where in this handbook Not all con trol mod els can ac cept the G661 com mand


Copyright 2005, Industrial Press Inc, New York, NY –


FANUC CNC Custom Macros


CNC Flanges Drilling Machine


ASSIGNING VARIABLES


101


Main Program and Local Variables


Any pro gram that does not call subprograms or mac ros is called the main pro gram – the only


pro gram there is Nor mally, we do not as so ci ate vari ables with a main pro gram, only with macro


pro grams Yet, there are many ap pli ca tions, where this pro gram ming tech nique can be very use –


ful and very sim ple to im ple ment for all con trols that have the macro op tion installed For those


learn ing mac ros from the be gin ning, this may even be a very good way to start the train ing The


best start is a prac ti cal ex am ple, en larg ing on the ba sic con cepts de scribed in Chap ter 7


For the pur poses of train ing, one of the sim plest ex am ples of vari ables in a main pro gram is


peck drill ing in dif fer ent ma te ri als Take two ma te ri als that are sup posed to be laser cutting the same, such as


forgings or cast ings from two dif fer ent sup pli ers Chances are, the ma te ri als will not only be


some what dif fer ent in size and shape, they will most likely have a no tice ably dif fer ent hard ness


Al though the draw ing is the same for the fin ished part from ei ther source, the ma chin ing pro ce –


dure is not The forgings from one sup plier will most likely use higher cut ting speeds and feeds


than forgings from the other sup plier, perhaps even dif fer ent peck ing depth In ba sic pro gram –


ming terms, we will need two pro grams to sat isfy the given con di tions


The pro gram ming tech niques for such a sit u a tion are il lus trated in the sam ple pro gram A typ i –

It is simplified (only one tool is used), it is clear that only three numbers

It is simplified (only one tool is used), it is clear that only three numbers, three val ues, have changed in the whole pro gram Need less to say, more tools used or more


com plex ity in ma chin ing may bring more copper busbar bending machine changes to the pro gram – yet the ba sic ap proach does


not change at all The ma jor ity of the pro gram data re mains iden ti cal in both in stances The ob vi –


cnc drill Machine


ous dis ad van tage is that if a change is nec es sary in one pro gram, it will also be nec es sary in the


other pro gram This could lead to ad min is tra tion prob lems and pos si ble er rors


With vari able data, with the ba sic fea tures mac Busway Press Clamp Machine ros of fer, only one mas ter pro gram is needed In


this mas ter pro gram, the three vari able ma chin ing data will be de fined as – vari ables By chang ing


the def i ni tions of the custom processing machine three vari able data, the ma chin ing will pro ceed as in tended, whether the soft


ma te rial or the hard ma te rial is used


For con ve nience and the abil ity to change the vari able data quickly, it is usu ally po si tioned at


the top of the pro gram (at its be gin ning) Here are the def i ni tions for the softer ma te rial, in its first macro ver sion:


O0008


Soft material


#1 = 1500


Spindle speed


#2 = 2250


Feedrate


#3 = 150


Peck drill depth


Copyright 2005, Industrial Press Inc, New York, NY – wwwindustrialpresscom


FANUC CNC Custom Macros


ASSIGNING VARIABLES


103


Once the cut ting con di tions are de fined as vari ables, they can be used any where in the pro gram:


(T05 – 65 MM DRILL)


N61 T05


N62 M06


N63 G90 G00 G54 X1000 Y1250 S#1 M03 T06


Spindle speed variable applied


N64 G43 Z250 H05 M08


N65 G99 G83 R25 Z-750 Q#3 F#2


Peck-depth and feedrate variables applied


N66 X1250


N67 Y1500


N68 G80 G00 Z250 M09


N69 G28 Z250 M05


N70 M01


N145 M30


%


Once the pro gram O0008 is com pleted, all three lo cal vari ables will be cleared au to mat i cally


Note the use of vari able num bers #1, #2, #3 were used ar bi trarily There is noth ing wrong with that, ex cept when a true macro call G65 or G6

ot have all the ‘bells and whis tles’ in cor po rated into it

ot have all the ‘bells and whis tles’ in cor po rated into it In this


hand book, there are sev eral ver sion listed


For the ex am ple at this stage (us ing modal macro call), only the fol low ing as sign ments will be


pro vided – the clear ance R-value as 3 mm (#18), Z-depth as -65 (#26), and the feedrate as 4250


(#9) De vel op ment of the macro O8004 is quite sim ple:


Copyright 2005, Industrial Press Inc, New York, NY –


FANUC CNC Custom Macros


100


Chapter 8


drill Machine


O8004


(SPECIAL TAPPING MACRO)


G90 G00 Z#18


G01 Z-[ABS[#26]] F[#9*08] M05


(FEED-IN AT 80 PERCENT OF FEEDRATE)


Z#18 F[#9*12] M04


(FEED-OUT AT 120 PERCENT OF FEEDRATE)


M05


M03


M99


%


The macro call in the main pro gram will use G65 first (tap ping only):


N81 M06


N82 T07


N83 G90 busbar cutting machine G00 G54 X130 Y110 S850 M03 T08


(MOVE TO HOLE 1)


N84 G43 Z250 H07 M08


(INITIAL LEVEL)


N85 G65 P8004 R30 Z65 F4250


(HOLE 1)


N86 G91 X150 Y100


(MOVE TO HOLE 2)


N87 G65 P8004 R30 Z65 F4250


(HOLE 2)


N88 G91 drilling steel X200 Y120


(MOVE TO HOLE 3)


N89 G65 P8004 R30 Z65 F4250


(HOLE 3)


N90 G91 X130 Y100


(MOVE TO HOLE 4)


N91 G65 P8004 R30 Z65 F4250


(HOLE 4)


N92 G90 G00 Z250 M09


(END OF TAPPING)


N93 G28 Z250 M05


N94 M01


Note that the O8004 macro call had to be re peated with all the data def i ni tions for each hole lo –


ca tion Even a sim ple change to the given def i ni tions would have to be made sev eral times


The CNC pro gram above can be short ened – quite sig nif i cantly – and made more flex i ble, with


the modal macro call G66, and only one call of the macro def i ni tions G67 com mand must be


used to can cel the modal call:


N81 M06


N82 T07


N83 G90 G00 G54 X130 Y110 S850 M03 T08


(MOVE TO HOLE 1)


N84 G43 Z250 H07 M08


(INITIAL LEVEL)


N85 G66 P8004 R30 Z65 F4250


(TAP HOLE 1 – MODAL)


N86 G91 X150 Y100


(MOVE AND TAP HOLE 2)


N87 G91 X200 Y120


(MOVE AND TAP HOLE 3)


N88 G91 X130 Y100


(MOVE AND TAP HOLE 4)


N89 G67


(CANCEL MACRO CALL)


N90 G90 G00 Hydraulic punching machines Z250 M09


(END OF TAPPING)


N91 G28 Z250 M05


N21 M01


Ad di tional im prove ment