CNC Programming
CNC Programming
Rao
Process planning Axes selection Tool selection Cutting process parameters planning Job and tool setup planning Machining path planning Part program writing Part program proving 13.1.1 Process planning Machine tool used Fixture(s) required Sequence of operations For each of operation Cutting tools required Process parameters
Fig. 13.1
Fig. 13.2 A typical component for NC machining Table 13.1 Process plan for the component shown in Fig. 13.2 Op. No. 10 20 30 40 Description End mill the top face, 100 100 mm End mill the steps, 20 100 5 mm Mill pocket, 40 40 8 mm Drill the six holes, 6 15 mm Tools Shell end mill, Shell end mill, HSS End mill, HSS twist drill, 60 mm 60 mm 10 mm 6 mm
Fig. 13.3 Part for NC machining shown with axes system at the centre
Fig. 13.4
Same part as in Fig. 13.3 but with axes system at the bottom left corner
Fig. 13.5
Fig. 13.6
Shaded 3D image of the tool cutting the part for providing more realistic proving of the NC part program (Courtesy Virtual Gibbs Inc.)
N115 G81 X120.5 Y55.0 Z-12.0 R2.0 F150 M3 13.2.1 ISO standards for coding
Character A B
Address For Angular dimension around X axis Angular dimension around Y axis
C D E F G H I J K L M N O P Q R S T U V W X Y Z
Angular dimension around Z axis Angular dimension around special axis or third feed function* Angular dimension around special axis or second feed function* Feed function Preparatory function Unassigned Distance to arc centre or thread lead parallel to X Distance to arc centre or thread lead parallel to Y Distance to arc centre or thread lead parallel to Z Do not use Miscellaneous function Sequence number Reference rewind stop Third rapid traverse dimension or tertiary motion dimension parallel to X* Second rapid traverse dimension or tertiary motion dimension parallel to Y* First rapid traverse dimension or tertiary motion dimension parallel to Z* Spindle speed function Tool function Secondary motion dimension parallel to X* Secondary motion dimension parallel to Y* Secondary motion dimension parallel to Z* Primary X motion dimension Primary Y motion dimension Primary Z motion dimension * Where D, E, P, Q, R, U, V, and W are not used as indicated, they may be used elsewhere.
CODE G00 G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 inches) G11 G12 G13-G16 G17 G18 G19 G20 G21 G22-G29 G30 G31 G32 G33 G34 G35 G36-G39 G40 G41 G42 G43 G44
FUNCTION Point-to-point positioning, rapid traverse Line interpolation Circular interpolation, clockwise (WC) Circular interpolation, anti-clockwise (CCW) Dwell Hold/Delay Parabolic interpolation Unassigned Acceleration of feed rate Deceleration of feed rate Linear interpolation for long dimensions (10 inches-100 Linear interpolation for short dimensions (up to 10 inches) Unassigned Axis designation XY plane designation ZX plane designation YZ plane designation Circular interpolation, CW for long dimensions Circular interpolation, CW for short dimensions Unassigned Circular interpolation, CCW for long dimensions Circular interpolation, CCW for short dimensions Unassigned Thread cutting, constant lead Thread cutting, linearly increasing lead Thread cutting, linearly decreasing lead Unassigned Cutter compensation-cancels to zero Cutter radius compensation-offset left Cutter radius compensation-offset right Cutter compensation-positive Cutter compensation-negative
G45-G52 G53 G54-G59 G60 G61 G62 G63 G64 G65-G69 G70 G71 G72-G79 G80 G81-G89 G90 G91 G92 G93 G94 G95 G96 G97 G98-G99
Unassigned Deletion of zero offset Datum point/zero shift Target value, positioning tolerance 1 Target value, positioning tolerance 2, or loop cycle Rapid traverse positioning Tapping cycle Change in feed rate or speed Unassigned Dimensioning in inch units Dimensioning in metric units Unassigned Canned cycle cancelled Canned drilling and boring cycles Specifies absolute input dimensions Specifies incremental input dimensions Programmed reference point shift Unassigned Feed rate/min (inch units when combined with G70) Feed rate/rev (metric units when combined with G71) Spindle feed rate for constant surface feed Spindle speed in revolutions per minute Unassigned
Rapid Positioning Linear Interpolation Circular interpolation Clockwise Circular interpolation Counter clockwise
Dwell
Active plane selection group *G17 XY Plane selection G18 XZ Plane selection G19 YZ Plane selection Cutter compensation group *G40 Cutter compensation, Cancel G41 Cutter radius Compensation left G42 Cutter radius Compensation right
Hole making canned cycle group *G80 Canned Cycle Cancel G81-G89 Canned Cycles definition and ON Co-ordinate system group *G90 Absolute co-ordinate system G91 Incremental co-ordinate system Preset G92
Fig. 13.8
Fig. 13.9
Fig. 13-11 YZ plane selection for horizontal axis milling machines 13.3.4 Preset, G92
Fig. 13-12 Setting the workpiece on the machine table N015 G92 X200.0 Y170.0 Z50.0
Absolute programming A to B N110 G90 G00 X50.0 Y45.0 Z 40.0 N120 X90.0 Y90.0 Z70.0
Fig. 13-14 Positioning, preparatory function G00 in 3 dimensions Incremental programming A to B N110 G90 G00 X50.0 Y45.0 Z 40.0 N120 G91 X40.0 Y45.0 Z30.0 Incremental programming B to A N110 G90 G00 X90.0 Y90.0 Z 70.0 N120 G91 X-40.0 Y-45.0 Z-30.0 Linear or Straight line Interpolation, G01
Fig. 13-15 Linear interpolation, preparatory function G01 Incremental programming A to B N110 G90 G00 X50.0 Y45.0 Z 40.0 N120 G91 G01 X40.0 Y45.0 Z30.0 F350 Incremental programming B to A N110 G90 G00 X90.0 Y90.0 Z 70.0 N120 G91 G01 X-40.0 Y-45.0 Z-30.0 F350
Dwell, G04
CODE
FUNCTION
M00 M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 M13 M14 M15 M16 M17-M18 M19 M20-M29 M30 M31 M32-M35 M36-M39 M40-M45 M46-M49 M50 M51 M52-M54 M55 M56 M57-M59 M60 M61 M62 M63-M67 M68 M69 M70 M71 M72 M73-M77
Program stop, spindle and coolant off Optional programmable stop End of program-often interchangeable with M30 Spindle on, CW Spindle on, CCW Spindle stop Tool change Coolant supply No. 1 on Coolant supply No. 2 on Coolant off Clamp Unclamp Unassigned Spindle on, CW + coolant on Spindle on, CCW + coolant on Rapid traverse in + direction Rapid traverse in - direction Unassigned Spindle stop at specified angular position Unassigned Program stop at end tape + tape rewind Interlock by-pass Constant cutting velocity Unassigned Gear changes; otherwise unassigned Unassigned Coolant supply No. 3 on Coolant supply No. 4 on Unassigned Linear cutter offset No. 1 shift Linear cutter offset No. 2 shift Unassigned Piece part change Linear piece part shift, location 1 Linear piece part shift, location 2 Unassigned Clamp piece part Unclamp piece part Unassigned Angular piece part shift, location 1 Angular piece part shift, location 2 Unassigned
Fig. 13-19 Example N001 G92 X0 Y0 Z0 absolute presetting at A. N002 G90 absolute programming. N003 G00 X25.0 Y25.0 Z2.0 T01 S3000 M03 tool brought rapidly at B, 2 mm above XY plane. N004 G01 Z-12.0 F120 tool goes down to full depth. N005 Y75.0 proceeds to C. N006 X65.0 proceeds towards right to D. N007 G02 Y25.0 I0 J-35.0 cuts curved profile till E. N008 X25.0 proceeds to B. N009 Z2.0 tool moves 2 mm above the XY plane N010 G00 Z50.0 M05 spindle stops and rapidly moves up N011 X0 Y0 rapid move to start position 0,0 N012 M30 end of program and tape rewind
Fig. 13-21 Tool path for machining the component for example 13.2
Fig. 13-22 Offset Tool path for machining contours that are not parallel to the principal axes
Table 13-2 Standard canned cycle motions Cann ed cycle numb er G80 G81 G82 G83 G84 G85 G86 G87 G88 G89 Feed from surface At programmed depth (end of feed point) Dw ell Off Constant Constant Intermittent Constant Constant Constant Constant Constant Constant Spindle return motion -Stop -Rapid --Rapid Yes -Rapid --Reverse Feed -Feed --Rapid Stop -Manual Stop -Manual Yes Stop Feed Yes -Spindle speed Used for
Cancel canned cycle Drilling, centre drilling Counter sinking, Counter boring Deep hole drilling Tapping Reaming Boring Multiple Boring Boring Boring
Fig. 13-27 Cutter radius compensation G40 Compensation `off'. G41 used when the cutter is on the left of the programmed path when looking in the direction of the tool movement, i.e. the radius compensation is considered to the left of the programmed profile.
Fig. 13.28 Example showing the cutter radius compensation using the G codes G42
Fig. 13.29 Example showing the cutter radius compensation using the G codes G41 and G42
Fig. 13.30 Example for contour programming using the cutter radius compensation