Page 2
Preface Preface Preface Preface Preface Organization Organization of of of of documentation documentation Organization Organization documentation documentation General Preparatory Function Interpolation Function Feed Function Coordinate System Spindle Speed Function Tool Function Miscellaneous Function Functions to Simplify Programming 10. Comprehensive Programming Example 11.
1. General 1 1 1 1 General General General General This chapter is to introduce the basic concepts in Computerized Numerical Control (CNC) system: HNC-21T/22T, HNC-18iT/19iT, HNC-18xp/T, HNC-19xp/T.
1. General Programming 1.1 CNC CNC Programming Programming Programming To operate CNC machine tool, the first step is to understand the part drawing and produce a program manual script. The procedure for machining a part is as follows (Figure 1.1): Read drawing Produce the program manual script Input the program manual script by using the machine control panel...
Page 7
1. General 1. Read drawing Φ60 Φ40 Ζ 2. Produce the program manual script N1 T0106 N2 M03 S460 N3 G00 X90Z20 N4 G00 X31Z3 N5 G01 Z-50 F100 N6 G00 X36 N7 Z3 … 3. Input the program manual script 4.
1. General Interpolation 1.2 Interpolation Interpolation Interpolation Interpolation refers to an operation in which the machine tool moves along the workpiece parts. There are five methods of interpolation: linear, circular, helical, parabolic, and cubic. Most CNC machine can provide linear interpolation and circular interpolation. The other three methods of interpolation (helical, parabolic, and cubic interpolation) are usually used to manufacture the complex shapes, such as aerospace parts.
1. General 1.2.2 1.2.2 Circular Circular Interpolation Interpolation 1.2.2 1.2.2 Circular Circular Interpolation Interpolation Figure 1.4 shows a tool movement along an arc. Figure 1.4 Circular Interpolation Note: Note: Note: Note: In this manual, it is assumed that tools are moved against workpieces. 1.2.3 1.2.3 Thread...
1. General Feed Function 1.3 Feed Feed Feed Function Function Function Feed refers to an operation in which the tool moves at a specified speed to cut a workpiece. Feedrate refers to a specified speed, and numeric is used to specified the feedrate. Feed function refers to an operation to control the feedrate.
Page 11
1. General Coordinate System 1.4 Coordinate Coordinate Coordinate System System System 1.4.1 1.4.1 Reference Reference Point Point 1.4.1 1.4.1 Reference Reference Point Point Reference point is a fixed position on CNC machine tool, which is determined by cams and measuring system. Generally, it is used when the tool is required to exchange or the coordinate system is required to set.
Page 12
1. General 1.4.2 1.4.2 Machine Machine Coordinate Coordinate System System 1.4.2 1.4.2 Machine Machine Coordinate Coordinate System System The coordinate system is set on a CNC machine tool. Figure 1.8 is a machine coordinate system of turning machine, and shows the direction of axes: Figure 1.8 Machine Coordinate System In general, three basic linear coordinate axes of motion are X, Y, Z.
1. General 1.4.3 1.4.3 Workpiece Workpiece Coordinate Coordinate System System 1.4.3 1.4.3 Workpiece Workpiece Coordinate Coordinate System System The coordinate system is set on a workpiece. The data in the NC program is from the workpiece coordinate system. 90° W W W W 90°...
Page 14
1. General 1.4.4 1.4.4 Setting Setting Coordinate Coordinate Systems Systems Systems at at at at the Same Same Position Position 1.4.4 1.4.4 Setting Setting Two Two Coordinate Coordinate Systems the Same Same Position Position There are two methods used to define two coordinate systems at the same position. The coordinate zero point is set at chuck face Φ60 Φ40...
1. General 1.4.5 1.4.5 Absolute Absolute Commands Commands 1.4.5 1.4.5 Absolute Absolute Commands Commands The absolute dimension describes a point at “the distance from zero point of the coordinate system”. Example: These four point in absolute dimensions are the following: P1 corresponds to X25 Z-7.5 P2 corresponds to X40 Z-15 P3 corresponds to X40 Z-25...
1. General 1.4.6 1.4.6 Incremental Incremental Commands Commands 1.4.6 1.4.6 Incremental Incremental Commands Commands The incremental dimension describes a distance from the previous tool position to the next tool position. Example: These four point in incremental dimensions are the following: P1 corresponds to X25 Z-7.5 //with reference to the zero point P2 corresponds to X15 Z-7.5 //with reference to P1 P3 corresponds to Z-10...
1. General 1.4.7 1.4.7 Diameter/Radius Diameter/Radius Programming Programming 1.4.7 1.4.7 Diameter/Radius Diameter/Radius Programming Programming The coordinate dimension on X axis can be set in diameter or radius. It should be noted that diameter programming or radius programming should be applied independently on each machine.
Page 18
1. General Spindle Speed Function 1.5 Spindle Spindle Spindle Speed Speed Speed Function Function Function The cutting speed (v) refers to the speed of the tool with respect to the workpiece when the workpiece is cut. The unit of the cutting speed is m/min. As for the CNC, the cutting speed can be specified by the spindle speed (N) in min V: Cutting speed Chuck...
1. General Tool Function 1.6 Tool Tool Tool Function Function Function 1.6.1 1.6.1 Tool Tool Selection Selection 1.6.1 1.6.1 Tool Tool Selection Selection It is necessary to select a suitable tool when drilling, tapping, boring or the like is performed. As it is shown in Figure 1.19, a number is assigned to each tool.
Page 20
1. General � Tool Length Compensation There are two kind of ways to specify the value of tool length compensation. Absolute value of tool length compensation (the distance between tool tip and machine reference point) Incremental value of tool length compensation (the distance between tool tip and the standard tool) As it is shown in Figure 1.21, L1 is the tool length on X axis.
Page 21
1. General The direction of imaginary tool nose is determined by the tool direction during cutting. Figure 1.23 and Figure 1.24 show the relation between the tool and the imaginary tool tip. ● ● ● Z Z Z Z ● ●...
1. General Miscellaneous Function 1.7 Miscellaneous Miscellaneous Miscellaneous Function Function Function Miscellaneous function refers to the operation to control the spindle, feed, and coolant. In general, it is specified by an M code. When a move command and M code are specified in the same block, there are two ways to execute these commands: Pre-M function M command is executed before the completion of move command...
1. General Program Configuration 1.8 Program Program Program Configuration Configuration Configuration Structure Structure Structure of of of of an an an Program Program Structure an NC NC Program Program 1.8.1 1.8.1 1.8.1 1.8.1 As it is shown in Figure 1.25, an NC program consists of a sequence of NC blocks blocks blocks blocks.
1. General Format of end end of of of of program program program program The last block should contain M02 or M03 to indicate the end of program. Format of Comments Comments Comments Comments All information after the “;” is regarded as comments. All information between “( )”...
2. Preparatory Function 2 2 2 2 Preparatory Preparatory Function code) Preparatory Function code) Preparatory Function Function (G (G code) code) There are two types of G code: one-shot G code, and modal G code. Table 2 1 Type of G code Type Type Type...
2. Preparatory Function 2.1 G G G G code code List code code List List List The following table is the list of G code in HNC system. Table 2 2 G code list G G G G code code code Group Group...
Page 28
2. Preparatory Function Stock Removal in Turning Stock Removal in Facing Pattern repeating Front drilling cycle Side drilling cycle Multiple thread cutting cycle Internal diameter/Outer diameter cutting cycle End face turning cycle Thread cutting cycle ◣G90 Absolute programming Incremental programming Setting a coordinate system ◣G94 Feedrate per minute...
3. Interpolation Function 3 3 3 3 Interpolation Interpolation Interpolation Functions Functions Interpolation Functions Functions This chapter would introduce: Positioning Command (G00) Linear Interpolation (G01) Circular Interpolation (G02, G03) Chamfering and Rounding (G01, G02, G03) Thread Cutting with Constant Lead (G32) Tapping (G34)
Page 30
3. Interpolation Function Positioning (G00) 3.1 Positioning Positioning Positioning (G00) (G00) (G00) Programming Programming Programming Programming G00 X(U)… Z(W)… Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters X, Z Coordinate value of the end point in the absolute command U, W Coordinate value of the end point in the incremental command Function...
Page 31
3. Interpolation Function Linear Interpolation (G01) 3.2 Linear Linear Linear Interpolation Interpolation Interpolation (G01) (G01) (G01) Programming Programming Programming Programming G01 X(U)… Z(W)… F… Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters X, Z Coordinate value of the end point in the absolute command U, W Coordinate value of the end point in the incremental command...
Page 32
3. Interpolation Function Example Example Example Example 1 1 1 1 Use G01 command to rough machining and finish machining the simple cylinder part. Φ35 Φ30 Figure 3.2 Linear Interpolation – Example 1 %3306 (Incremental command) %3306(Absolute command) N1 T0106 N1 T0101 N2 M03 S460 N2 M03 S460...
Page 33
3. Interpolation Function Example Example Example Example 2 2 2 2 Use G01 command to rough machining and finish machining simple conical part. Φ26 Φ30 Φ35 Figure 3.3 Linear Interpolation – Example 2 %3307 N1 T0101 N2 M03 S460 N3 G00 X100Z40 N4 G00 X26.6 Z5 N5 G01 X31 Z-50 F100 N6 G00 X36...
Page 34
3. Interpolation Function Example Example Example Example 3 3 3 3 Use G01 command to rough machining and finish machining the part. 2×45° Φ35 Φ30 Φ24 Φ28 Figure 3.4 Linear Interpolation – Example 3 %3308 N1 T0101 N2 M03 S450 N3 G00 X100 Z40 N4 G00 X31 Z3 N5 G01 Z-50 F100...
Page 36
3. Interpolation Function Circulation Interpolation (G02, G03) 3.3 Circulation Circulation Circulation Interpolation Interpolation Interpolation (G02, (G02, (G02, G03) G03) G03) Programming Programming Programming Programming I_K_ ⎧ ⎫ ⎧ ⎫ ⎨ ⎬ ⎨ ⎬ ⎩ ⎭ ⎩ ⎭ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 37
3. Interpolation Function G02 and G03 are defined when the working plane is specified. Figure 3.6 shows the direction of circular interpolation. +Z Z Z Z +Z Z Z Z Figure 3.6 Direction of Circular Interpolation Function Function Function Function The tool is moved along a full circle or arcs.
Page 38
3. Interpolation Function Example Example Example Example 1 1 1 1 Use the circular interpolation command to program Figure 3.7 Circular Interpolation – Example 1 %3309 N1 T0101 N2 G00 X40 Z5 N3 M03 S400 N4 G00 X0 N5 G01 Z0 F60 N6 G03 U24 W-24 R15 N7 G02 X26 Z-31 R5 N8 G01 Z-40...
Page 39
3. Interpolation Function Example Example Example Example 2 2 2 2 Use the circular interpolation command to program Φ30 Φ35 Figure 3.8 Circular Interpolation – Example 2 %3310(Absolute programming) %3310(Incremental programming) N1 T0101 N1 T0101 N2 M03 S460 N2 M03 S460 N3 G00 X90Z20 N3 G00 X90Z20 N4 G00 X0 Z3...
Page 40
3. Interpolation Function Example Example Example Example 3 3 3 3 Use the circular interpolation command to program. Figure 3.9 Circular Interpolation – Example 3 %3311 N1 T0101 N2 M03 S460 N3 G00 X100 Z40 N4 G00 X0 Z3 N5 G01 Z0 F100 N6 G03 X20 Z-10 R10 N7 G01 Z-20 N8 G02 X24 Z-24 R4...
Page 41
3. Interpolation Function Example Example Example Example 4 4 4 4 Use the circular interpolation command to program Φ26 Φ30 Figure 3.10 Circular Interpolation – Example 4 %3312 N1 T0101 N2 M03 S460 N3 G00 X80 Z10 N4 G00 X30 Z3 N5 G01 Z-20 F100 N6 G02 X26 Z-22 R2 N7 G01 Z-40...
3. Interpolation Function Chamfering Rounding (G01, G02, G03) 3.4 Chamfering Chamfering Chamfering and and Rounding Rounding Rounding (G01, (G01, (G01, G02, G02, G02, G03) G03) G03) Note: Note: Note: Note: These commands can not be used in thread cutting. 3.4.1 Chamfering (G01) 3.4.1...
3. Interpolation Function 3.4.2 3.4.2 Rounding Rounding (G01) (G01) 3.4.2 3.4.2 Rounding Rounding (G01) (G01) Programming Programming Programming Programming G01 X(U)_ Z(W)_ R_ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters X, Z Coordinate values of the intersection (point G) in absolute command U, W Coordinate values of the intersection (pint G) in incremental command Radius of the rounding (r)
Page 44
3. Interpolation Function Example Example Example Example Use the chamfering and rounding command (G01): 70 70 70 70 10 10 10 10 3 3 3 3 36 36 36 36 22 22 22 22 Figure 3.13 Chamfering and Rounding (G01) - Example %3314 N1 M03 S460 N2 G00 U-70 W-10...
Page 45
3. Interpolation Function 3.4.3 3.4.3 Chamfering Chamfering (G02, (G02, G03) G03) 3.4.3 3.4.3 Chamfering Chamfering (G02, (G02, G03) G03) Programming Programming Programming Programming ⎧ ⎫ ⎨ ⎬ ⎩ ⎭ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters X, Z...
Page 46
3. Interpolation Function 3.4.4 3.4.4 Rounding Rounding (G02, (G02, G03) G03) 3.4.4 3.4.4 Rounding Rounding (G02, (G02, G03) G03) Programming Programming Programming Programming ⎧ ⎫ ⎨ ⎬ ⎩ ⎭ Explanation Explanation Explanation Explanation of of of of the the parameters parameters parameters parameters...
Page 47
3. Interpolation Function Example Example Example Example Use the chamfering and rounding command (G02/G03): 70 70 70 70 10 10 10 10 4 4 4 4 36 36 36 36 21 21 21 21 Figure 3.16 Chamfering and Rounding (G02/G03) - Example %3315 N1 T0101 N2 G00 X70 Z10 M03 S460...
Page 48
3. Interpolation Function Thread Cutting with Constant Lead (G32) 3.5 Thread Thread Thread Cutting Cutting Cutting with with with Constant Constant Constant Lead Lead Lead (G32) (G32) (G32) Programming Programming Programming Programming G32 X(U)__Z(W)__R__E__P__F__ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 49
3. Interpolation Function X X X X Start point offset in ° Starting angle for thread (setting data) Z Z Z Z Figure 3.18 Start point Offset Function Function Function Function Cylindrical thread, taper thread and face thread can be machined with G32. Note: Note: Note:...
Page 50
3. Interpolation Function Example Example Example Example Given that F=1.5mm, =1.5mm, =1mm, cutting for four times and each cutting depth δ ′ δ is separately: 0.8mm, 0.6 mm, 0.4mm, 0.16mm. It is diameter programming. 80 80 80 80 Figure 3.19 Thread Cutting – Example %3316 N1 T0101 N2 G00 X50 Z120...
3. Interpolation Function Tapping (G34) 3.6 Tapping Tapping Tapping (G34) (G34) (G34) Programming Programming Programming Programming G34 K_ F_ P_ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters The distance from the starting point to the bottom of the hole Thread lead Dwell time at the bottom of a hole Figure 3.20 Rigid Tapping...
Page 52
3. Interpolation Function Table 3 1 PMC parameters CNC system system system system PMC parameters parameters parameters parameters #0062 Maximum spindle speed during tapping #0063 Minimum spindle speed during tapping HNC 18/19i #0064 Dwelled unit for tapping #0065 Optional dwelled unit for tapping #0017 Maximum spindle speed during tapping #0018...
Page 53
3. Interpolation Function Example Example Example Example The following is a tested data for tapping when the thread lead is 1.25mm. %0034 T0101 S100 G90G1X0Z0F500 G34K-10F1.25P2 S200 G90G1X0Z0F500 G34K-10F1.25P2 S300 G90G1X0Z0F500 G34K-10F1.25P2 S400 G90G1X0Z0F500 G34K-20F1.25P2 S500 G90G1X0Z0F500 G34K-30F1.25P3 S600 G90G1X0Z0F500 G34K-40F1.25P3 S700 G90G1X0Z0F500...
4. Feed Function 4 4 4 4 Feed Feed Feed Function Function Feed Function Function There are two kinds of feed functions: Rapid Traverse The tool is moved at the rapid traverse speed set in CNC. Cutting Feed The tool is moved at the programmed cutting feedrate. Moreover, this chapter would introduce “Dwell”.
Page 55
4. Feed Function Rapid Rapid Traverse Traverse (G00) (G00) 4.1 Rapid Rapid Traverse Traverse (G00) (G00) Positioning command (G00) is to move the tool at the rapid traverse speed (the highest possible speed). This rapid traverse speed can be controlled by the machine control panel. For more detailed information, please refer to turning operation manual.
Page 56
4. Feed Function Cutting Cutting Feed Feed (G94, (G94, G95) G95) 4.2 Cutting Cutting Feed Feed (G94, (G94, G95) G95) Programming Programming Programming Programming G94 [F_ ] G95 [F_ ] Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters...
4. Feed Function Dwell Dwell (G04) (G04) 4.3 Dwell Dwell (G04) (G04) Programming Programming Programming Programming G04 P_ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters dwell time (specified in seconds) Function Function Function Function It can be used to interrupt machining to get the smooth surface.
5. Coordinate System 5 5 5 5 Coordinate Coordinate System Coordinate System Coordinate System System This chapter would introduce: Reference Position Return (G28) Auto Return from Reference Position (G29) Setting a Workpiece Coordinate System (G92) Selecting a Machine Coordinat System (G53) Selecting a Workpiece Coordinate System (G54~G59) Origin of a Workpiece Coordinate System (G51, G50) Absolute and Incremental Programming (G90, G91)
Page 59
5. Coordinate System Reference Position Return (G28) 5.1 Reference Reference Reference Position Position Position Return Return Return (G28) (G28) (G28) Programming Programming Programming Programming G28 X(U)_ Z(W)_ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters X, Z Coordinate values of the intermediate point in absolute command...
Page 60
5. Coordinate System Auto Return from Reference Position (G29) 5.2 Auto Auto Auto Return Return Return from from from Reference Reference Reference Position Position Position (G29) (G29) (G29) Programming Programming Programming Programming G29 X(U)_ Z(W)_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 61
5. Coordinate System Example Example Example Example Use G28, G29 command to program the track shown in. It moves from the starting point A to the intermediate point B, and then returns to the reference point R. At last, it moves from the reference point R to the end point C through the intermediate point B.
Page 62
5. Coordinate System Setting Setting Setting a a a a Workpiece Workpiece Workpiece Coordinate Coordinate System System (G92) (G92) 5.3 Setting Workpiece Coordinate Coordinate System System (G92) (G92) Programming Programming Programming Programming G92 X_ Z_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 63
5. Coordinate System Selecting Selecting a a a a Machine Machine Cooridinate System (G53) 5.4 Selecting Selecting Machine Machine Cooridinate Cooridinate Cooridinate System System System (G53) (G53) (G53) Programming Programming Programming Programming G53 X_Z_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 64
5. Coordinate System Selecting a a a a Workpiece Coordinate System 5.5 Selecting Selecting Selecting Workpiece Workpiece Workpiece Coordinate Coordinate Coordinate System System System (G54~G59) (G54~G59) (G54~G59) (G54~G59) Programming Programming Programming Programming ⎧ ⎫ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪...
Page 65
5. Coordinate System Example Example Example Example Select one of workpiece coordinate system, and the tool path is Current point→A→B. Machine Zero Point Figure 5.4 Workpiece Coordinate System – Example %3303 N01 G54 G00 G90 X40 Z30 N02 G59 N03 G00 X30 Z30 N04 M30...
Page 66
5. Coordinate System Origin Origin of of of of a a a a Workpiece Workpiece Coordinate System (G51, 5.6 Origin Origin Workpiece Workpiece Coordinate Coordinate Coordinate System System System (G51, (G51, (G51, G50) G50) G50) G50) Programming Programming Programming Programming G51 U_ W_ Explanation Explanation...
Page 67
5. Coordinate System Absolute Incremental Programming (G90, 5.7 Absolute Absolute Absolute and and Incremental Incremental Incremental Programming Programming Programming (G90, (G90, (G90, G91) G91) G91) G91) Programming Programming Programming Programming G90 X_ Z_ G91 U_W_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 68
5. Coordinate System Example Example Example Example Move the tool from point 1 to point 2 through point 3, and then return to the current point. Φ Φ Φ Φ 15 15 15 15 Φ Φ Φ Φ 50 50 50 50 Φ...
Page 69
5. Coordinate System Diameter Radius Programming (G36, G37) 5.8 Diameter Diameter Diameter and and Radius Radius Radius Programming Programming Programming (G36, (G36, (G36, G37) G37) G37) Programming Programming Programming Programming Explanation Explanation of of of of the parameters Explanation Explanation the parameters parameters parameters...
Page 70
5. Coordinate System Example Example Example Example Use Diameter programming and Radius programming for the same path Figure 5.6 Diameter and Radius Programming – Example Diameter Programming Radius Programming Compound Programming %3304 %3314 %3314 N1 G92 X180 Z254 N1 G37 M03 S460 N1 T0101 N2 M03 S460 N2 G54 G00 X90 Z254...
Page 71
5. Coordinate System Inch/Metric Inch/Metric Conversion Conversion (G20, (G20, G21) G21) 5.9 Inch/Metric Inch/Metric Conversion Conversion (G20, (G20, G21) G21) Programming Programming Programming Programming Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters G20: Inch input G21: Metric input The units of linear axis and circular axis are shown in the following table Table 5 1 .
6. Spindle Speed Function 6 6 6 6 Spindle Spindle Speed Function Spindle Speed Function Spindle Speed Speed Function Function Spindle function controls the spindle speed (S), the unit of spindle speed is r/min. Spindle speed is the cutting speed when it is at the constant speed, the unit of speed is m/min. S is modal G code command;...
Page 73
6. Spindle Speed Function Limit Limit of of of of Spindle Spindle Speed (G46) 6.1 Limit Limit Spindle Spindle Speed Speed Speed (G46) (G46) (G46) Programming Programming Programming Programming G46 X_ P_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 74
6. Spindle Speed Function Constant Surface Speed Control (G96, G97) 6.2 Constant Constant Constant Surface Surface Surface Speed Speed Speed Control Control Control (G96, (G96, (G96, G97) G97) G97) Programming Programming Programming Programming G96 S G97 S Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 75
6. Spindle Speed Function Example Example Example Example Use the constant surface control command Figure 6.1 Constant Surface Control – Example %3318 N1 T0101 N2 G00 X40 Z5 N3 M03 S460 N4 G96 S80 N5 G46 X400 P900 N5 G00 X0 N6 G01 Z0 F60 N7 G03 U24 W-24 R15 N8 G02 X26 Z-31 R5...
7. Tool Function 7 7 7 7 Tool Tool Function Tool Function Tool Function Function This chapter would introduce: Too selection and Tool offset (T code) Tool radius compensation (G40, G41, G42)
Page 77
7. Tool Function Tool Selection Tool Offset Offset (T (T (T (T code) code) 7.1 Tool Tool Tool Selection Selection Selection and and Tool Tool Tool Offset Offset code) code) Programming Programming Programming Programming T XX XX Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 78
7. Tool Function Example Example Example Example %0012 N01 T0101 N02 M03 S460 N03 G00 X45 Z0 N04 G01 X10 F100 N05 G00 X80 Z30 N06 T0202 N07 G00 X40 Z5 N08 G01 Z-20 F100 N09 G00 X80 Z30 N10 M30...
Page 80
7. Tool Function Example Example Example Example Use the tool radius compensation, and program for the part shown in Figure 7.2 Figure 7.2 Tool Radius Compensation %3323 N1 T0101 N2 M03 S400 N3 G00 X40 Z5 N4 G00 X0 N5 G01 G42 Z0 F60 N6 G03 U24 W-24 R15 N7 G02 X26 Z-31 R5 N8 G01 Z-40...
8. Miscellaneous Function 8 8 8 8 Miscellaneous Miscellaneous Function Miscellaneous Function Miscellaneous Function Function As it is mentioned in Chapter 1.8, there are two ways of execution when a move command and M code are specified in the same block. Pre-M function M command is executed before the completion of move command.
8. Miscellaneous Function 8.1 M M M M code code List code code List List List The following is a list of M command. Table 8 2 M code List M-function Type Type of of of of Mode Mode Function Pre/Post-M function CNC M-function...
Page 83
8. Miscellaneous Function M-Function 8.2 CNC CNC M-Function M-Function M-Function 8.2.1 8.2.1 Program Program Stop Stop (M00) (M00) 8.2.1 8.2.1 Program Program Stop Stop (M00) (M00) M00 is one-shot M function, and it is post-M function. The program can be stopped, so that the operator could measure the tool and the part, adjust part and change speed manually, and so on.
Page 84
8. Miscellaneous Function 8.2.5 8.2.5 Subprogram Subprogram Control Control (M98, (M98, M99) M99) 8.2.5 8.2.5 Subprogram Subprogram Control Control (M98, (M98, M99) M99) � End of Subprogram (M99) M99 indicates the end of subprogram and returns control to the main program. It is one-shot M function, and it is post-M function.
Page 85
8. Miscellaneous Function Example Example Example Example 4.923 44.8 73.436 Figure 8.1 Subprogram Control - Example %3111 N1 G92 X32 Z1 N2 G00 Z0 M03 S46 N3 M98 P0003 L5 N4 G36 G00 X32 Z1 N5 M05 N6 M30 %0003 N1 G37 G01 U-12 F100 N2 G03 U7.385 W-4.923 R8 N3 U3.215 W-39.877 R60...
Page 86
8. Miscellaneous Function 8.3.1 8.3.1 Spindle Spindle Control Control (M03, (M03, M04, M04, M05) M05) 8.3.1 8.3.1 Spindle Spindle Control Control (M03, (M03, M04, M04, M05) M05) M03 starts spindle to rotate CW at the set speed set in the program. M04 starts spindle to rotate CCW at the set speed in the program.
9. Functions to Simplify Programming 9 9 9 9 Functions Functions Functions to to to to Simplify Simplify Programming Functions Simplify Programming Simplify Programming Programming This chapter would introduce: Canned Cycle Internal diameter/ Outer diameter cutting cycle (G80) End face turning cycle (G81) Thread cutting cycle (G82) End face peck drilling cycle (G74) Outer diameter grooving cycle (G75)
Page 88
9. Functions to Simplify Programming Canned Cycles 9.1 Canned Canned Canned Cycles Cycles Cycles To simplify programming, the canned cycle command can execute the specific operation using one G code, instead of several separated G commands in the program. 9.1.1 Internal Diameter/Outer Diameter...
Page 89
9. Functions to Simplify Programming � � � � Taper Taper Taper Taper Cutting Cutting Cutting Cutting Cycle Cycle Cycle Cycle Programming Programming Programming Programming G80 X(U)_ Z(W)_ I_ F_ Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters...
Page 90
9. Functions to Simplify Programming Example Example Example Example 1 1 1 1 Use G80 command to – rough machining and finish machine the cylindrical part in two steps machining. Φ 30 Φ 35 Figure 9.3 Internal Diameter/Outer Diameter Cutting Cycle – Example 1 %3320 N1 T0101 N2 M03 S460...
Page 91
9. Functions to Simplify Programming Example Example Example Example 2 2 2 2 Use G80 command to – rough machining and finish machine the tapered part in two steps machining. Φ35 Φ26 Φ30 Figure 9.4 Internal Diameter/Outer Diameter Cutting Cycle – Example 2 %3321 N1 T0101 N2 G00 X100Z40 M03 S460...
Page 92
9. Functions to Simplify Programming Example Example Example Example 3 3 3 3 Use G80 command to – rough machining and finish machine the tapered part in two steps machining. 2×45° Φ Φ Φ Φ Figure 9.5 Internal Diameter/Outer Diameter Cutting Cycle – Example 3 %3322 N1 T0101 N2 M03 S460...
Page 93
9. Functions to Simplify Programming 9.1.2 9.1.2 Face Face Turning Turning Cycle Cycle (G81) (G81) 9.1.2 9.1.2 End End Face Face Turning Turning Cycle Cycle (G81) (G81) � � � � Face Face Face Face Cutting Cutting Cutting Cutting Cycle Cycle Cycle Cycle...
Page 94
9. Functions to Simplify Programming � � � � Taper Taper Taper Taper Face Face Face Face Cutting Cutting Cutting Cutting Cycle Cycle Cycle Cycle Programming Programming Programming Programming G81 X(U)_ Z(W)_ K_ F_ Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 95
9. Functions to Simplify Programming Example Example Example Example Use G81 to program. The dashed line stands for the roughcast. 33.5 33.5 33.5 33.5 3 3 3 3 8 8 8 8 Figure 9.8 End Face Turning Cycle (G81) %3323 N1 T0101 N2 G00 X60 Z45 N3 M03 S460...
Page 97
9. Functions to Simplify Programming � � � � Taper Taper Taper Taper Thread Thread Thread Thread Cutting Cutting Cutting Cutting Cycle Cycle Cycle Cycle Programming Programming Programming Programming G82 X(U)_ Z(W)_ I_ R_ E_ C_ P_ F(J)_ Explanation Explanation Explanation of of of of the parameters parameters...
Page 98
9. Functions to Simplify Programming Example Example Example Example Use G82 command to program. The screw’s pitch is 1.5, and the number of thread head is 2. 80 80 80 80 Figure 9.11 Thread Cutting Cycle - Example %3324 N1 G54 G00 X35 Z104 N2 M03 S300 N3 G82 X29.2 Z18.5 C2 P180 F3 N4 X28.6 Z18.5 C2 P180 F3...
Page 99
9. Functions to Simplify Programming 9.1.4 9.1.4 Face Face Peck Peck Drilling Drilling Cycle Cycle (G74) (G74) 9.1.4 9.1.4 End End Face Face Peck Peck Drilling Drilling Cycle Cycle (G74) (G74) Programming Programming Programming Programming G74 Z(W)_ R(e) Q(△K) F_ Explanation Explanation Explanation of of of of the...
Page 100
9. Functions to Simplify Programming Example Example Example Example Use G74 to drill a hole on a workpiece. Figure 9.13 End Face Peck Drilling Cycle – Example %1234 T0101 M03S500 G01 X0 Z10 G74 Z-60R1Q5F1000...
Page 101
9. Functions to Simplify Programming 9.1.5 9.1.5 Outer Outer Diameter Diameter Grooving Grooving Cycle Cycle (G75) (G75) 9.1.5 9.1.5 Outer Outer Diameter Diameter Grooving Grooving Cycle Cycle (G75) (G75) Programming Programming Programming Programming G75 X(U)_ R(e) Q(△K) F_ Explanation Explanation Explanation of of of of the parameters parameters...
Page 102
9. Functions to Simplify Programming Example Example Example Example Use G75 to groove a hole on a workpiece. Φ80 Figure 9.15 Outer Diameter Grooving Cycle - Example %1234 T0101 M03S500 G01 X50 Z50 G75 X10R1Q5F1000...
Page 103
9. Functions to Simplify Programming Multiple Repetitive Cycle 9.2 Multiple Multiple Multiple Repetitive Repetitive Repetitive Cycle Cycle Cycle Multiple repetitive cycle command can only use one command to finish the rough machining and the finish machining. 9.2.1 Stock Removal Removal in in in in Turning Turning (G71) 9.2.1...
Page 104
9. Functions to Simplify Programming Function Function Function Function This command can do a stock removal in facing without groove. The machining path is A→A'→B Note Note Note Note G00 or G01 must be used in the finishing program – between P(ns) and Q(nf). Otherwise, there is an alarm message.
Page 105
9. Functions to Simplify Programming Example Example Example Example 1 1 1 1 The initial point A is (46, 3). The depth of cut is 1.5mm (radius designation). The retraction amount is 1mm. The finishing allowance in the X direction is 0.6mm, and the finishing allowance in the Z direction is 0.1mm.
Page 106
9. Functions to Simplify Programming Example Example Example Example 2 2 2 2 The initial point A is (6, 3). The depth of cut is 1.5mm (radius designation). The retraction amount is 1mm. The finishing allowance in the X direction is 0.6mm, and the finishing allowance in the Z direction is 0.1mm.
Page 107
9. Functions to Simplify Programming � � � � Stock Stock Stock Stock Removal Removal Removal Removal in in in in Turning Turning Turning Turning with with with with Groove Groove Groove Groove Programming Programming Programming Programming G71 U(△d) R(r) P(ns) Q(nf) E(e) F(f) S(s) T(t) Explanation Explanation Explanation of of of of the...
Page 108
9. Functions to Simplify Programming Example Example Example Example Use G71 to program. 61.5 32.5 2×45° 45° 30° Figure 9.21 Stock Removal in Turning with Groove - Example %3327 N1 T0101 N2 G00 X80 Z100 M03 S400 N3 G00 X42 Z3 N4G71U1R1P8Q19E0.3F100 N5 G00 X80 Z100 N6 T0202...
9. Functions to Simplify Programming Programming Programming Programming Programming G72 W(Δd) R(r) P(ns) Q(nf) X(Δx) Z(Δz) F(f) S(s) T(t) Explanation Explanation Explanation of of of of the parameters parameters Explanation the parameters parameters W(△d) the cutting depth (radius designation). The cutting direction depends on the direction of AA’.
Page 110
9. Functions to Simplify Programming Note Note Note Note G00 or G01 must be used in the finishing program – between P(ns) and Q(nf). Otherwise, there is an alarm message. G72 can not be used in MDI mode. G98 and G99 can not used in the finishing program – between P(ns) and Q(nf). The direction of △x and △z is shown in the following figure.
Page 111
9. Functions to Simplify Programming Example Example Example Example 1 1 1 1 Use G72 to program. The initial point A is (80, 1). The depth of cutting is 1.2mm. The retraction amount is 1mm. The finishing allowance in the X direction is 0.2mm, and the finishing allowance in the Z direction is 0.5mm.
Page 112
9. Functions to Simplify Programming Example Example Example Example 2 2 2 2 Use G72 to program. The initial point A is (80, 1). The depth of cutting is 1.2mm. The retraction amount is 1mm. The finishing allowance in the X direction is 0.2mm, and the finishing allowance in the Z direction is 0.5mm.
9. Functions to Simplify Programming 9.2.3 9.2.3 Pattern Pattern Repeating Repeating (G73) (G73) 9.2.3 9.2.3 Pattern Pattern Repeating Repeating (G73) (G73) Programming Programming Programming Programming G73 U(ΔI) W(ΔK) R(r) P(ns) Q(nf) X(Δx) Z(Δz) F(f) S(s) T(t) Explanation Explanation Explanation of of of of the parameters parameters Explanation...
Page 114
9. Functions to Simplify Programming Function Function Function Function G73 command can cut a wokpiece at a fixed pattern repeatedly. The machining path is A→A'→B. Note Note Note Note G00 or G01 must be used in the finishing program – between P(ns) and Q(nf). Otherwise, there is an alarm message.
Page 115
9. Functions to Simplify Programming Example Example Example Example Use G73 to program. The initial point A is (60, 5). The total roughing allowance on X and Z axis are 3mm, 0.9mm, respectively. The times of rough cutting is 3. The finishing allowance on X and Z axis are 0.6mm, 0.1mm respectively.
Page 117
9. Functions to Simplify Programming Function Function Function Function G76 command can do the multiple thread cutting. The machining path is A→B→C→D. Note Note Note Note The signs of U and W is defined by the direction of AC and CD respectively. ∆...
Page 118
9. Functions to Simplify Programming Example Example Example Example Use G76 to program. The thread is ZM60×2. Sizes in bracket is from standards. (tan1.79=0.03125) 4 4 4 4 3 3 3 3 0 0 0 0 (18) (18) (18) (18) 6 6 6 6 (12) (12)
Page 119
10. Comprehensive Programming 10 10 10 10 Comprehensive Comprehensive Comprehensive Programming Programming Comprehensive Programming Programming 10.1 10.1 Example Example Example 1 1 1 1 10.1 10.1 Example Program for the part shown in the figure. The processing condition: material: #45 steel, or aluminum;...
10. Comprehensive Programming 10.2 10.2 Example Example Example 2 2 2 2 10.2 10.2 Example Program for the part shown in the figure. The processing condition: material: #45 steel, or aluminum; diameter of the part is Φ26mm, length of the part is 70mm. Tool selection: number 1 cylindrical tool is used to rough turning the contour, number 2 cylindrical tool is used to finish turning the contour, number 3 cylindrical thread tool is used to machine the thread.
10. Comprehensive Programming 10.3 10.3 Example Example Example 3 3 3 3 10.3 10.3 Example Program for the tapered thread ZG2″ shown in the figure. According to the standard, the pitch is 2.309mm(25.4/11), the thread height is 1.479mm. Other sizes are shown in the figure.
10. Comprehensive Programming 10.4 10.4 Example Example Example 4 4 4 4 10.4 10.4 Example Program for the M40×2 inner thread shown in the figure. According to the standard, the pitch is 2.309mm(25.4/11), thread height is 1.299mm. Other sizes are shown in the figure. The depth of cut at each time(diameter designation) is 0.9mm, 0.6mm, 0.6mm, 0.4mm and 0.1mm.
11. Custom Macro 11 11 11 11Custom Custom Custom Macro Macro Custom Macro Macro Similarly to subprogram, the custom macro function allows operators to define their own program. The way of calling the custom macro is same as subprogram’s. The difference is that custom macro allows use of variables, arithmetic and logic operations, selection and repetition.
11. Custom Macro 11.1 Variables 11.1 11.1 11.1 Variables Variables Variables Format Explanation Format Format Format and and Explanation Explanation Explanation Variable is composed of a number sign (#) and a number. Example Example Example Example #1=#2+100 11.1.1 11.1.1 Type Type Type of of of of Variables Variables...
11. Custom Macro 11.1.2 11.1.2 System System Variables Variables 11.1.2 11.1.2System System Variables Variables #1000 “current position X in machine coordinate system” #1001 “current position Y in machine coordinate system” #1002 “current position Z in machine coordinate system” #1003 “current position A in machine coordinate system” #1004 “current position B in machine coordinate system”...
Page 128
11. Custom Macro #1031 “origin Y in workpiece coordinate system” #1032 “origin Z in workpiece coordinate system” #1033 “origin A in workpiece coordinate system” #1034 “origin B in workpiece coordinate system” #1035 “origin C in workpiece coordinate system” #1036 “origin U in workpiece coordinate system” #1037 “origin V in workpiece coordinate system”...
Page 129
11. Custom Macro #1063 “origin A of G56” #1064 “origin B of G56” #1065 “origin C of G56” #1066 “origin U of G56” #1067 “origin V of G56” #1068 “origin W of G56” #1069 reserved #1070 “origin X of G57” #1071 “origin Y of G57”...
Page 130
11. Custom Macro #1095 “origin C of G59” #1096 “origin U of G59” #1097 “origin V of G59” #1098 “origin W of G59” #1099 reserved #1100 “break point X” #1101 “break point Y” #1102 “break point Z” #1103 “break point A” #1104 “break point B”...
Page 132
11. Custom Macro #1159 “modal value of G code – 9” #1160 “modal value of G code – 10” #1161 “modal value of G code – 11” #1162 “modal value of G code – 12” #1163 “modal value of G code – 13” #1164 “modal value of G code –...
Page 133
11. Custom Macro #1191 “customized output” #1192 “customized output shield” #1193 reserved #1194 reserved #2000~#2600 data for the repetitive cycle #2000 number of contour point #2001~#2100 type of contour (0: G00, 1: G01, 2: G02, 3: G03) #2101~#2200 contour point X (diameter or radius designation) #2201~#2300 contour point Z #2301~#2400 contour point R #2401~#2500 contour point I...
11. Custom Macro 11.4 Assignment 11.4 11.4 11.4 Assignment Assignment Assignment Assignment refers to assign a variable value to a constant or expression. Format: Format: Format: Format: Variable=constant or expression Example #2 = 175/SQRT[2] * COS[55 * PI/180] #3 = 124.0...
Page 137
11. Custom Macro 11.5 11.5 Selection Selection statement statement statement IF, IF, IF, IF, ELSE,ENDIF ELSE,ENDIF ELSE,ENDIF 11.5 11.5 Selection Selection statement ELSE,ENDIF Format Format Format Format (i) (i) (i) (i) IF Conditional expression … ELSE … ENDIF Explanation Explanation Explanation Explanation (i) (i) (i) (i) If the specified conditional expression is satisfied, the statements between IF and ELSE are...
Page 138
11. Custom Macro 11.6 Repetition Statement WHILE, ENDW 11.6 11.6 11.6 Repetition Repetition Repetition Statement Statement Statement WHILE, WHILE, WHILE, ENDW ENDW ENDW Format Format Format Format WHILE Conditional expression … ENDW Explanation Explanation Explanation Explanation When the conditional expression is satisfied, the statements between WHILE and ENDW are executed.
11. Custom Macro 11.7 Macro Call 11.7 11.7 11.7 Macro Macro Macro Call Call Call The following table shows the local variable and the corresponding system variable when it is macro call. Table 11 2 Transmission of Macro Call Local Local Local Local variables...
Page 140
11. Custom Macro Explanation Explanation Explanation Explanation To check whether the variable is defined in the program, the format is as follows: AR [#Variable number] Return: 0 – the variable is not defined 90 – the variable is defined as absolute command G90 91 –...
11. Custom Macro 11.8 Example 11.8 11.8 11.8 Example Example Example Example Example 1 1 1 1 Example Example − Program the parabola B in interval [0, 8] shown in Figure 11.1. The parabola Ф Ф Ф Ф 16 16 16 16 Ф...
Page 142
11. Custom Macro Example Example Example Example 2 2 2 2 − Program the parabola B in interval [0, 8] shown in Figure 11.2. The parabola 4 4 4 4 Figure 11.2 Custom Macro Example 2 %3402 T0101 G00 X21 Z3 M03 S600 #10=7.5 WHILE #10 GE 0...
Page 143
11. Custom Macro Example Example Example Example 3 3 3 3 Program the parabola B in interval [12, 32] shown in Figure 11.3. The parabola − 5 5 5 5 Figure 11.3 Custom Macro Example 3 %3403 N1 T0101 N2 G00 X20.5 Z3 N3 #11=12 N4 M03 S600 N5 WHILE #11 LE 32...
Page 144
11. Custom Macro Example Example Example Example 4 4 4 4 Program the parabola B in interval [12, 32] shown in Figure 11.4. The parabola − Figure 11.4 Custom Macro Example 4 %3404 N1 T0101 N2 G00 X25 Z3 N3 #11=12 N4 M03 S600 N5 WHILE #11 LE 32 N6 #10=SQRT[2*[#11]]...
Page 145
11. Custom Macro Example Example Example Example 5 5 5 5 Program the part shown in Figure 11.5. Figure 11.5 Custom Macro Example 5 %3405 N1 T0101 N2 G00 X90 Z30 N3 U10 V50 W80 A20 B40 C3 M98 P01(#20=10, #21=50, #22=80, #0=20, #1=40, #2=3) N4 M30 N1 G00 Z[-#22+#21+#20] N2 X[#1+5]...
Need help?
Do you have a question about the HNC-18iT v4.0 and is the answer not in the manual?
Questions and answers