// ---------------------------------------- // // The following SmartCAM code generator has been // created to generate NC code for the respective // machine and control combinations listed below. // // Due to differences in programming styles, // controller versions, and optional equipment, // SmartCAMcnc DOES NOT and CANNOT guarantee // that the NC code generated is correct for any // specific machine. Some modification to the code // generator to match your setup and output // requirements is likely necessary. // // Modifications to code generators do not TYPICALLY // require a significant amount of time. SmartCAM // customers with active SSA contracts are entitled // to support for their code generators from the // SmartCAMcnc Support Group. To contact them for // support, please send an email to: // Support@SmartCAMcnc.com. If you would like // information on purchasing SSA for your SmartCAM // products, please contact: Sales@SmartCAMcnc.com // // DISCLAIMER: It is the responsibility of the end // user to confirm and verify that the NC code // created by any code generator is accurate and // will not cause a machine malfunction which // could result in stock, tooling, machine, and/or // personal injury. // // SmartCAMcnc assumes no responsibility or // liability for any damage caused or alleged to // have been caused by the use of any of the code // generators it provides. // ---------------------------------------- @COMMENTS 08/07/90 Machine Type: Hitachi Seiki Minimatic 500 Horizontal Machining Center Control Type: Fanuc 5 M Application Notes: 1. This Custom Code Generator has been specially designed to support the following fixed cycles on the Fanuc 5 M: G81 - Drilling Cycle with no Dwell G82 - Spot Drilling Cycle with Dwell G73 - Chip Break Drill Cycle (See note #6) G83 - Peck Drill Cycle (See Note #6) G84 - Tapping Cycle G85 - Boring Cycle G40 - Cutter Compensation Cancel \ G41 - Cutter Compensation Left >--(See Note #3) G42 - Cutter Compensation Right / M00 - Program Stop \ >--(See Note #9) M01 - Optional Stop / M71 - Pallet Index (See Note #12) G54 - G59 Work Coordinate Offsets (See Note #13) G94 - Zero Position Offset (Always output as X,Y, and Z "0" to be edited by the operator) G04 - Dwell (See Note #11) 2. SmartCAM will automatically output G40, G41, and G42 cutter diameter compensation if the contouring tool has an offset left or right specified in Shape. It will also automatically add a Lead_ In move of .050", turn on cutter compensation, then turn it off after the tool retracts in "Z". However, if you choose to use SmartCAM's Lead_In Lead_Out feature in the Tool_Path menu, SmartCAM will ignore the automatic feature and use the Lead_In Lead_Out geometry that you create. You will need to use this selection if you need a Lead_In move greater than the .050" default amount, and if your machine tool will not accept a G40 with no X or Y linear move. The default amount can be changed by changing the MHSFNH01 Machine Define question #122 (Utilities, Machine Define, Files, Read, Leadwell from SmartCAM Main Menu). Profiles with no offset do not require Lead_In Lead_Out moves. If NO cutter compensation is desired, you MUST assign a "0" in the Doff column in Job_Plan. This sets a switch within the coding process to ignore G40, G41 and G42 codes. To use CDC, assign the desired CDC machine register number in the Doff column This will code the profile with CDC and the desired "D" number (e.g. G01 G41 D33 X12.345 Y-3.4567). The following procedure is suggested for Lead_In Lead_Out moves: If you wish to use Lead_In and Lead_Out Lines only, it is best to use an Angle of 90 degrees and a Length greater than the tool radius. If you wish to use Lead_In and Lead_Out Arcs, it is best to use a Radius equal to the same amount and an Angle of 45 degrees, then Lead_In and Lead_Out Lines to those Arcs at an Angle of 90 degrees and a length equal to the same amount. Any time Lead_In and Lead_Out Arcs are used, Lead_In and Lead_Out Lines are absolutely necessary. The .050" is automatic unless otherwise specified. 3. To output a clockwise spindle direction, type in a positive number as the speed in Job Plan. To output a counter-clockwise spindle direction, type in a negative speed in Job Plan. If no speed is specified in Job Plan for a tool, an M05 will be output. A "+" sign is not necessary for positive numbers, but the "-" sign is required for reversing the spindle. 4. Work coordinate offsets may be assigned in Shape with a User_Cmd. This is done by entering the text as "@G55", "@G56", etc. A G54 is automatically output at the beginning of the program. If another offset is desired as the INITIAL offset, one of the following variables must be set either in the Notes section in Job_Plan or in the Tool_Comment line of the first tool. #C0=0 This will output a G54 #C0=1 " " " " G55 #C0=2 " " " " G56 #C0=4 " " " " G57 #C0=5 " " " " G58 #C0=6 " " " " G59 Different work coordinate offsets can also be called from part to part. The procedure is noted as follows: Program your first workpiece in SmartCAM at the desired coordinates. Next, program your second workpiece at the new location. Note the XY distance from the first 0,0 to the second. Then, just before the machining process starts on the second part, place a User_Cmd at the second part's 0,0 position with the text @G5?(#YPOFF=???). This will assign the desired work coordinate offset number, and also output code from their respective 0,0 locations. If both parts are the same but using different work coordinates, and you wish to copy the second part, make sure to set the Copy Mode to Sort by Tools, No, before you make the copy. This will output code for the first part in its entirety before moving to the next part. The #XPOFF, #YPOFF, and #ZPOFF words tell SmartCAM how far one part is from another in the respective axies. When using more than one word, separate them with a comma (#XPOFF=???,#YPOFF=???,#ZPOFF=???). A sample file called LEADWELL.SH2 containing examples has been furnished on your CCG disk, and has been stored in \SM4\DATA\ on your hard disk. 5. SmartCAM will default to a G73 chip break drill cycle if the "PECK" Hole_Op is selected in Shape when setting the features for the drill. However, if you require a G83 peck cycle, assign #U1=83 in the tool comment line of the drill that you need to use the G83 cycle with. This will change the cycle from G73 to G83. In order to switch the cycle back to G73, reassign #U1=73 in the next drill's tool comment line. Otherwise, the cycle will remain in the G83 mode. When assigning the variable #U1, you must use a capital letter and preceed it with the "#" symbol. The depth of each peck is assigned by the template variable word #PECK. This word may be assigned in the Tool Comment line or Notes section of Job_Plan, or with a User_Command in Shape. It may also be reassinged from one tool to another. If no value is assigned, it will default to .100". This value may also be changed with Question #150 in the MHSFNH01 Machine Define file (Utilities Machine Define, Files, Read, MHSFNH01 from SmartCAM Main Menu). 6. SmartCAM will default to a G84 tap cycle. If a G74 cycle (left-hand) is required, input the tap speed as a minus value. 7. There are several variable variable words available for your use in changing the default value assigned to these words (e.g. #SPEED=?? will change the spindle speed value). These words can be found in Reference Manual under the Code Generator section. They may be assigned in Job_Plan in the Notes section, or in the Tool_Comment line. They may also be assigned with User_Commands in Shape. 8. Program Stop (M00) and Optional Stop (M01) may be programmed in Shape by User_Commands. Place the User_Command immediately after the cut that you want the M code to follow (e.g., if after cutting from point "A" to point "B" you want a program stop, place the User_Cmd at point "B"'s coordinates with the text being @M00). 9. The default dwell amount is .2 seconds. This value may be changed by using the word #DWELL=???, by a User_Cmd with the text #DWELL=??? or by changing Machine Define Question number 50. 10. A part description may be output in the first line of the part program assigning #S1=Part Description in the Notes section of Job_Plan. 11. In order to output an index code (M71), place a User_Cmd in Shape following the last element in the shape geometry representing the workpiece that is on one side of the pallet. The text for the User_ Cmd will be either @90, @180, or @270. These numbers represent the rotational amount, and will output the correct number of M71 lines necessary for the rotation. Also, the #ZPOS word must be assigned in the text to output the desired "Z" retract position. Example: @180(#ZPOS=15) This will move "Z" to 15" at the current "X", "Y" location, then rotate the pallet 180 degrees. 12. The G92 command may be output in Shape by placing a User_Cmd in Shape at the desired location. The #?POFF words must be assigned, and the line will be output with the "X", "Y", and "Z" values set to "0" to be edited at the control by the operator. @START % :#FILE(#S1) #ONBLK #ABSI #MOV G80 G40 M71 #OFFBLK( T#TOOL #TDESC #TLCMT) #ONBLK G92 X0 Y0 Z0 M01 #ABSI #MOV G80 G40 S#SPEED #SPNDL #MOV X#XPOS Y#YPOS #C0 M08 G46 Z#ZPOS H#LOFF @TOOLCHG < #FXD>< #MOV> G46 Z0.0 H#LOFF M09 #TLCHG < X#XPOS>< Y#YPOS> M05 M06 #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) #OFFBLK(T#LTOOL EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.)#ONBLK M01 #RESET(#ABSI,#MOV,#SPNDL) #ABSI G80 #MOV G40 S#SPEED #SPNDL #OFFBLK( T#TOOL #TDESC #TLCMT) #ONBLK< #MOV>< X#XPOS>< Y#YPOS>< #C0> M08 G46 Z#ZPOS H#LOFF #EVAL(#U3=#LOFF) #EVAL(#U9=0) @END #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) #OFFBLK(T#LTOOL EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.) #EVAL(#U1=INT(#CYTIME)) #EVAL(#U2=#CYTIME-#U1) #EVAL(#U0=#U2*60) (TOTAL EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.)#ONBLK < FXD>< #MOV> G27 Z0 H#FMT(#U3,L2.0) M09 G27 X0 Y0 M05 M06 M30 #OFFBLK% @STPROF < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS> @RAP < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS> @LINE < #MOV>#IF(#DOFF<>0)<< #DCOMP#EXC< D#DOFF>>>< X#XPOS>< Y#YPOS>#EXLN < Z#ZPOS>< F#FEED> @ARC < #MOV>< X#XPOS>< Y#YPOS>< I#XCTR>< J#YCTR>< F#FEED> @ZCLRMV < #ABSI>< #FXD><< #MOV> Z#ZPOS> @ZCHKMV < #FXD><< #MOV> Z#ZPOS> @ZDPTHMV << #MOV> Z#ZPOS< F#FEED>> @FXD1 < #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> @FXD2 < #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED>#EXLN < P#DWELL> @FXD3 #IF(#SPNDL=2)<#EVAL(#C4=1)> #IF(#U9<>1)<#RESET(#C4,#FEED)> < #ABSI>< #C4>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> #EVAL(#U9=1) @FXD4 < #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> @FXD5 #IF(#U1=83)<#EVAL(#C3=1)> #IF(#U9<>1)<#RESET(#C3)> < #ABSI>< #C3>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK Q#PECK>< F#FEED> #EVAL(#U9=1) @DWELL G04 P#DWELL @G54 #EVAL(#C0=0) < #C0> @G55 #EVAL(#C0=1) < #C0> @G56 #EVAL(#C0=2) < #C0> @G57 #EVAL(#C0=3) < #C0> @G58 #EVAL(#C0=4) < #C0> @G59 #EVAL(#C0=5) < #C0> @M00 M00 @M01 M01 @90 < #MOV> G46 G27 Z#ZPOS H#LOFF M09 G27 X#XPOS Y#YPOS M05 M71 @180 < #MOV> G46 G27 Z#ZPOS H#LOFF M09 G27 X#XPOS Y#YPOS M05 M71 M71 @270 < #MOV> G46 G27 Z#ZPOS H#LOFF M09 G27 X#XPOS Y#YPOS M05 M71 M71 M71 @G92 G92 X0.0 Y0.0 Z0.0 @