Numerical Control Technology School of Mechanical Engineering Jiangnan University
REVIEWS Chapter 6 CNC Machine Programming 6.1 CNC Machining Programming Foundation 6.2 CNC Lathe Manual Programming 6.3 CNC Milling Machine Manual Programming 6.4 CNC Machining Center Manual Programming
6.2 CNC Lathe Manual Programming Review: The content and Procedure of CNC Programming The Engineering Analysis of CNC Programming The Mathematical Treatment of CNC Programming The Element of Constituting CNC Programming
6.2 CNC Lathe Manual Programming Main point : Classification of CNC turning machine Process scope of CNC turning machine Fabrication processing of CNC turning machine Programming of CNC turning machine Key and Difficult Points : The process technology of CNC lathe Circular interpolation Cutter Compensation Workpiece Coordinate System and Machine Coordinate Systern
Cutting Line: The general principle of planning cutting line: To guarantee the machining accuracy and surface roughness of mechanical elements Truncating the cutting line, reducing the feed/ discharge time and other auxiliary time To choose the path that make the workpiece s deformation small To provide convenience for numerical calculation, reduce the amount of programming
To Analyze the Cutting Line of Taper Turning: the last cutting is finish turning ; the last clearance S must be calculated accurately after the first and second cutting. The back cutting depth of rough turn is the same, but the back cutting depth of finish turning is different. Figure a
According to the similar bias cutting line in the figure b, the last clearance S of rough turn can be calculated by the similar triangles. confirm the every back cutting depth a p, don't need to calculate the last clearance. Figure b Figure c
To Analyze the Cutting Line of Lathing Circular Arc The different radius of clean-up are used to lathe the circular arc in this method. After confirming the every back cutting depth a P in this method, the coordinates of the starting point and the ending point of the arc can be calculated.
lathe the circular cone surface lathe the concentric arc surface
Command F The command F is used to control the feed rate of cut. There are two methods of use in the programming. The format : G95 F~ The format : G94 F~
Command S The command S is used to control the spindle speed. The format: G96 S~ The format: G97 S~ The format : G50 S~
Command T The command T is used to choose the tool. The format : T~
The Tool Position Correction The format: T I ---- the number of the selected tool I---- the number of cutter length compensation T 00 means to cancel the cutter compensation. Cutting Tool Radius Compensation The format: G40(G41/G42) G01(G00) X Z F D xx; D xx------- the number of the cutter compensation; G40:to cancel the cutter radius compensation; G41:the left cutter radius compensation; G42:the right cutter radius compensation;
G42 G41 G41 G42 The way of the cutting radius compensation
Command M to control the underaction and status of the NC machine. The common commands M are provided below. M00: program halt; M01: plan stop; M03: spindle clockwise rotation ; M04: spindle anti clockwise rotation; M05: spindle stop; M06: tool changing; M08: coolant on; M09: coolant off; M30: program stop, Program reset.
Machine Coordinate System G50 The format : G50 X~ Z~ The value of the letters of X and Z is the difference that the coordinate of the cutter starting point relative to the MCS Origin. This command s application method is analogous to the G92. According to the picture,the program of machine coordinate setup is provided below: G50 X128.7 Z375.1
G00 makes the machine tool reach the next position by the maximum speed. Its process includes the acceleration and deceleration. The format : G00 X(U) Z(W) According to the picture,the program of location is provided below: G50 X200.0 Z263.0 G00 X40.0 Z212.0 or G00 U-160.0 W-51.0 Quick Positioning G00
G01 diverts the machine tool from the current position to the target location by the determinate feed speed. The format : G01 X(U) Z(W) F ; method of absolute coordinates G01 X40.0 Z20.1 F0.2; The method of relative coordinates G01 U20.0 W-25.9 F0.2;
Circular Interpolation Command G02 G03 G03 Clockwise circular interpolation command format : G02 X(U) Z(W) I K F ; G02 X(U) Z(W) R F ; Counter-clockwise circular interpolation command format : G03 X(U) Z(W) I K F ;; G03 X(U) Z(W) R F ;
圆 弧 编 程 指 令 说 明 G02 is clockwise circular interpolation command G03 is counterclockwise circular interpolation command
Suspension Command G04 G04 command For the suspension of feeding. command format : G04 P or G04 X(U) The length of pause time can be specified by address X (U) or P.
Inch and Metric Input Command G20 G21 G21 G20: Inch input command G21: metric input command G20 and G21 are two commands can be replaced each other
Feed Speed Dimension Control Command G98 G99 G99 Two methods to set turning feed mode, G99 G01X Z F ; G98 G01X Z F ;
Reference Point Return Check Command G27 G27 used to test X-axis and Z-axis reference point return is correct. command format is: G27 X(U) Z(W) X(U) Z(W) are reference point coordinates. Implementation of the G27 command on the premise that you must do manual reference point return once.
Reference Point Return Command G28 G30 G30 G28 X(U) Z(W) ; The first reference point return, which X(U) Z(W) are the mid-point of reference point return, X Z are absolute coordinates,u W are relative coordinates. G30 P2 X(U) Z(W) ; The second reference point return,p2 is optional G30 P3 X(U) Z (W) ; The third reference point return G30 P4 X(U) Z(W) ; The forth reference point return The second, third and fourth reference point return in X (U), Z (W) and G28 in the meaning of the same.
Turning Fixed Loop Command G90 Excircle turning fixed loop command format: G90 X(U) Z(W) F The loop is mainly used for machining excircle of shaft. Where: X Z- - End point coordinates by cylindrical cutting; U W-- Coordinates 单 一 循 环 圆 柱 面.swf
As shown, With the G90 command programming, blank diameter ф34,workpiece diameter ф24,turning three times, programming with absolute value. O080 N05 M03 S400 N10 G92 X60 Z80 N15 G00 X40 Z60 N20 G90 X30 Z20 N30 G90 X27 Z20 N40 G90 X24 Z20 N50 G00 X60 Z80 N60 M02
Turning Fixed Loop Command G90 Cutting cone loop command format: G90X(U) Z(W) R F The loop is mainly used for machining cone of shaft.
Surface Turning Fixed Loop Command G94 Vertical surface turning fixed loop command format: G94 X(U) Z(W) F G94 command is used in rough turn vertical surface or a cone surface which is rough or directly from a larger margin Bar before finish turning.
Surface Turning Fixed Loop Command G94 Cone Surface Turning fixed loop command format: G94 X(U) Z(W) R F
O0081 N10 G00 X60 Z45 M03 N20 G94 X25 Z31.5 R- 3.5 F100 N30 X25 Z29.5 R-3.5 N40 X25 Z27.5 R-3.5 N50 X25 Z25.5 R-3.5 N60 M05 N70 M02
Multiple Fixed Loop G70 G71 G71 G72 G72 G73 G74 G74 G75 G75 G70 - G76 are CNC lathe multiple fixed loop commands,as the single fixed loops, can be used for processing must be repeated several times in order to process to the required size of a typical process. This is mainly used for rough turning casting or forging blank.
Excircle/Bore Rough Turn Loop Command G71 The command applies to rough turn the blank materials outside diameter and inside diameter. The command format: G71 U(Δd) R(e) G71 P Q U(Δu)W( u)w(δw)f S T
Surface Rough Turning Loop G72 As shown, G72 and G71 commands have the same meaning, the difference is that cutting to the direction parallel to X-axis, it is a surface rough turning loop cutting to the direction from outside diameter to axis, The loop method is suitable for rough turning the the direction of cylindrical rod blank surface.g72 Surface rough turning loop programming command format: G72 U(Δd) R(e); G72 P Q U(Δu)W( u)w(δw)f S T The meaning of each parameter in the command G72 is as same as that in command G71.
Fixed Geometry Rough G73 command format: Turning Loop G73 G73 UΔi WΔk Rd G73 Pns Qnf UΔu WΔw Ff Ss Tt The meaning of each parameter: Δi: Retract distance and direction along the X-axis. Δ k : Retract distance and direction along the Z- axis The meaning of other parameters as same as the G71.
Finishing Loop G70 This command can be used for parts finishing after rough turning loop commands G71 G72 G72 or G73,command format: G70 P Q U W ; the meaning of each parameter in command is as follows: P: the first paragraph program number of finishing process.; Q: the last paragraph program number of finishing process; U: finishing allowance along the X direction; W:finishing allowance along the Z direction.
ThreadProcessing Commands G32 G92 G92 G76 G76 CNC lathes can machining straight thread taper thread end thread,as shown Processing methods: single-stroke thread cutting Simple thread cutting loop and Thread cutting combined-loop.
Single-Stroke Thread Cutting Command G32 Command format: G32 X(U) Z(W) F In the command X(U) Z(W) are end point coordinates of thread,f is lead of thread.
As shown, the route of feed is A-B-C-D-A, machining taper thread, lead of thread is 4mm, δ,1 = 3mm, δ 2 = 2mm, each back engagement is 1 mm, cutting depth is 2mm G00 X16 G32 X44 W-45 F4 G00 X50 W45 X14 G32 X42 W-45 F4 G00 X50 W45
The command G92 can used for machining cylindrical thread and taper thread, Its loop route is same as Fixed geometry rough turning loop foregoing. The command format: G92 X(U) Z(W) R F Threadprocessing Loop Commands G92
G50 X100 Z50; G97 S300 T0101 M03; G00 X80 Z2; G92 X49.6 Z-48 R-5 F2; X48.7; X48.1; X47.5; X47.1; X47; G00 X100 Z50 T0000; M05; M02;
Subroutine Call Programming CNC lathe program also has the main and subroutine form. CNC system run according to the main program, however, it runs according to the subroutine program when meet the subroutine call in the main program ; In the subroutine call meet the end command will automatically return and give control back to the main program.
Subroutine Call For some machining shapes in program which are sequential fixed or repeated, It can be written as subroutines, then the main program to call, This can greatly simplify the programming the whole program. The workpiece as shown in Figure 2-50,as the workpiece is too thin,there can be machining in once clamp, here programming subroutines for only one workpiece: boring internal hole, turning internal thread, turning surface, cut off and so on. The whole turning program is the main program. When programming, simply call the three subroutines, turning there workpiece only need to change the programming zero spot.
Figure 2-50 Subroutine call Legend
CNC Lathe CNC Programming Example 1 Try to programming the machining program of the workpiece in figure 1.Blank diameter 25mm,length 50mm.
CNC Lathe CNC Programming Example 1 1. Clamping workpiece with the three-jaw chuck 2. First Processing excircle R8.5,length22.5 length22.5,rough machining and finishing three times,then then machining counterclockwise arc R2.5,last, clockwise arc R2.5 3. Program origin: Choose B,Coordinate(X15 Coordinate(X15,Z5)
CNC Lathe CNC Programming Example 1 4. Tool: External Turning Tool ( left-cut tool ) cutting parameters: S800 rough machining S1000 finishing arc machining F1000 -- Rapid positioning movements F80 Linear machining F40 -- arc machining 5. Fill in the program sheet
CNC Lathe CNC Programming Example 1 Y G18 G03 G02 G02 G02 G19 Axis and direction G17 G03 X G03 Z
CNC Lathe CNC Programming Example 1 Coordinate origin and the starting point of program
CNC Lathe CNC Programming Example 1 Absolute / Incremental programming method(g90/g91 G90/G91) Absolute mode:all coordinates are measured to a certain fixed origin. Relative mode:trajectories end point coordinates are measured to starting point coordinates
CNC Lathe CNC Programming Example 1 N1 G21 ;unit, mm N2 G90 ; Absolute mode programming, N3 G50 X15 Z5 ; machining beginning, distance from the origin N4 G00 X13 Z0.5 F1000 T1 S800; Fast close to the workpiece
CNC Lathe CNC Programming Example 1 N5 G73 D0 3;rough machining, loop three times N6 G91;turn to relative mode N7 G00 X-1 Z0 F1000 T1 S800; N8 G01 X0 Z-25.5 F80 T1 S800; N9 G00 X0 Z25.5 F1000 ; Backtrack N10 G06; End loop
CNC Lathe CNC Programming Example 1 N11 G73 D0 2; finishing,loop tow times N12 G00 X-1 Z0 S1000; penetration of a tool 1mm N13 G01 X0 Z-23 F80 ; N14 G00 X0.5 Z0; Away from the workpiece N15 G00 X0 Z23;Back N16 G06 ; N17 G90 ;
CNC Lathe CNC Programming Example 1 N18 G00 X8.6 Z-22.4 ; Rapid positioning N19 G01 X8.5 Z-22.5 F100; Close to the machining points N20 G03 X10 Z-25 R2.5 F40; Counterclockwise circle machining N21 G02 X12.5 Z-27.5 R2.5 F40 ; Counterclockwise circle machining N22 G00 X15 Z0 ; Retract N23 G00 X15 Z5 ; Back to program origin N24 M05 ; Spindle Stop N25 M02 ; END
CNC Lathe CNC Programming Example 2 According to the workpiece wait for machining in figure4-35, Material is 45 # steel, here cylindrical surface Ф 85 needn t to be machined. The process Carried out in the CNC lathe : turning encircle Ф 80mm and Ф 62mm ; Arc surface R70mm Cone Retract slot Thread and Chamfering. Requirements analysis process and the process route, Write processing.
Analysis of Workpiece Machining Process 1. Set the workpiece coordinates According to the principles of the benchmark coincides, set the origin of coordinates at the intersection of right surface and rotary axis,op as shown in the figure,and set ATC-point coordinates (200,100) relative to workpiece coordinate origin with command G50. 2. Select Tool According to part drawing processing requirements,surface cylindrical surface conical surface Circular surface Chamfer and cutting thread Retract slot and thread of workpiece waiting for machining, You need to use a total of three tools.
Analysis of Workpiece Machining Process No. 1 tool, encircle left-cut tool, Tool model : CL-MTGNR-2020/R/1608 ISO30 Installed in the No. 1 tool position. No. 3 tool, Thread tool, Tool model :TL- LHTR-2020/R/60/1.5 ISO30 Installed in the No. 3 tool position. No. 5 tool, Cut slot tool, Tool model :ER- SGTFR-2012/R/3.0-0 IS030 Installed in the No. 5 tool position.
Machining Process Analysis 3. Processing Program use No.1 left-dislocation cylindrical tool, take rough machining first and then finishing of end face and the outer surface of the workpiece, leave 0.5mm finish turning allowance in the course of roughing; Use NO.5 slot cutting tool to cut ; then use the NO.3 threading tool to process screw thread.
Machining Process Analysis 4. Determine the cutting parameters Cutting depth : Set the cutting depth as 3mm in the course of roughing while 0.5mm in the course of finishing. Spindle Speed : According to the cutting performance of 45 steel, set the cutting speed to 90m/min while processing the end face and the outer surface of the workpiece; Set spindle speed to 250r/min while cutting thread. Feedrate:Set feed rate to 200mm/min in the course of roughing,set feed rate to 50mm/min in the course of finishing. Set feed rate to 1.5mm / r while cutting thread.
Programming and Operation 1. Programming 2. Input the procedure to CNC In the MDI mode, input programs directly into CNC system, or through the computer communications interface, input they into the CNC system. Then simulate machining in the CRT screen, testing accuracy of procedures.
Programming and Operation 3. Manual operation of tool Setting Through the operation of tool setting set workpiece coordinate system, Record Tool Tip Offset value of each tool. When operating processes, call the tool offset number, to Compensate the value of tool tip offset. 4. Automatic machining operation Select automatic operation mode, Then press the cycle starting button, Machine will be in the processing of fully automated processing of the workpiece according to the preparation.
O0001 Procedure Code N005 G50 X200 Z100; Establishment of the workpiece coordinate system N010 G50 S3000 ; The maximum spindle speed is limited to 3000r/min N015 G96 S90 M03; Spindle is transferred Forward, constant wire-speed is set to 90m/min N020 T0101 M06 ; Select No. 1 Circular left-side tool and No. 1 Tool Compensation N025 M08 ; Coolant On N030 G00 X86 Z0; ; tool Quickly navigate to Cutting Position N035 G01 X0 F50; Turning Face N040 G00 Z1; Z-exit 1mm
N045 G00 X86; back to 86mm at X direction, to prepare cylindrical cutting cycle N050 G71 U3 R1; Cylindrical cutting roughing cycle,cutting depth is 3mm, Retract amount is 1mm. N055 G71 P60 Q125 U0.5 W0.5 F200; Cylindrical cutting roughing cycle,0.5mm finishing allowance left at x and Z direction,cutting speed for 200mm/min N060 G42; Tip radius right compensation N065 G00 X43.8; N070 G01 X47.8 Z-1 ; N075 Z-60 ; N080 X50 ;
N085 X62 Z-120 ; N090 Z-135 ; N095 X78 ; N100 X80 Z-136 ; N105 Z-155 ; N110 G02 Z-215 R70 ; N115 G01 Z-225 ; N120 X86 ; N125 G40 ; cancel Tip radius compensation N130 G70 P60 Q125 F50; Cylindrical cutting finishing cycle,cutting speed for 50mm/min
N135 G00 X200 Z100; Tool back to the ATC point N140 T0505 M06 S50; Choose NO.5 cutting tool and NO.5 Tool Compensation,Constant Constant Velocity is set to 50m/min. N145 G00 X52 Z-60; Fast-forward to X52, Z-60, Ready to cut slot. N150 G01 X45; Cut gewindefreistiche N155 G04 X2; 2 seconds pause at the bottom N160 G01 X52; Back to 52mm at X direction N165 G00 X200 Z100; Tool back to the ATC point N170 T0303 M06 ; Select NO.3 threading tool and NO.3 Tool Compensation N175 G95 G97 S250 ; Cutting speed dimension setting, Constant speed setting for 250r/min
N180 G00 X50 Z3; Fast-forward to X = 50, Z = 3, prepare Turning thread N185 G76 P011060 Q0.1 R1 ; thread cutting circle N190 G76 X46.38 Z-58.5 R0 P1.48 Q0.4 F1.5; N200 G00 X200 Z100 T0300; Quickly returned to ATC Point, cancel No. 3 tool Compensation N205 M05; N210 M09 ; N215 M30 ; Spindle Stop Coolant off End of the process