Computer Aided Manufacturing-II
Computer Aided Manufacturing-II
CIM
Example
N25 G00 X2.5 Y4.75 Rapid to X2.5 Y4.75
N30 Z0.1 Rapid down to Z0.1
G01 Linear Interpolation
N_ G01 X_ Y_ Z_ F_
Example
N30 G01 Z-0.125 F5 feed Down to Z-0.125 at ipm
N_ G02 X_ Y_ Z_ I_ J_ K_ F_
N_ G02 X_ Y_ Z_ R_ F_
Example
N35 G02 X2 Y2 I1 J0 F20
N45 G02 X3 Y0.5 R2 F20
G02 Circular Interpolation (CW)
Center Point X1 Y1
Start Point X1 Y2
__________________________
Radius I0 J-1
Result
G02 X2 Y1 I0 J-1 F5
G02 Circular Interpolation (CW)
Example
G02 CW CIRCULAR INTERPOLATION USING "I", &"J"
FOR THE X & Y AXIS
G02 CW CIRCULAR INTERPOLATION USING “R”
G03 Circular Interpolation (CCW)
The G03 command requires an endpoint and a radius
N_ G03 X_ Y_ Z_ I_ J_ K_ F_
N_ G03 X_ Y_ Z_ R_ F_
Example
N40 G03 X3 Y3.5 I-0.5 J0 F20
N60 G03 X3.5 Y1 R0.5 F20
G03 Circular Interpolation (CCW)
Center Point X2 Y1
Start Point X2 Y2
__________________________
Radius I0 J-1
Result
G03 X1 Y1 I0 J-1 F5
G03 Circular Interpolation (CCW)
Example
G03 CCW CIRCULAR INTERPOLATION USING "I", &"J"
FOR THE X & Y AXIS
G03 CCW CIRCULAR INTERPOLATION USING “R”
G04 Dwell
N_ G04 P_
• The G04 command is a Dwell command that halts all axis
movement for a specified time, while the spindle continuous
revolving at the specified rpm.
Example
N30 G04 P2
(Dwell for 2 seconds)
Machine Tool Planes
• A typical CNC machining center has three axes. Any two axes
form a plane. A machine plane may be defined by looking at the
machine from standard operating position.
• For a vertical machining center, there are three standard views
• For all rapid motions (programmed with G00) and all linear
motions (programmed with G01), the plane selection
command is not needed.
• G20 command defaults the system to inch data units. When you
are running a program and encounter the G20 command, all
coordinates are stated in inch units
Example
N5 G90 G21 Set to absolute mode and metric units
G91 Incremental Positioning
N_ G91
Example
N5 G91 G21 Set to incremental mode and metric units
Cutter Compensation
N_ M04
Example
%
:1010
N5 G90 G20
N10 M06 T12
……………………………………………….
N65 M05 (Spindle stop)
M06 Tool Change
N_ M06 T_
• The M06 code is used to initiate a tool change. The previously
selected tool (T_) is put into the spindle. If the spindle was
running, it will be stopped.
The Z-axis will automatically move up to the machine zero
•
position and the selected tool will be put into the spindle. The Z-
axis is left at machine zero.
• The T_ must be in the same block or in a previous block. The
coolant pump will be turned off during a tool change.
Example
%
:1010
N5 G90 G20
N10 M06 T12 (Tool change to tool #12)
……………………………………………….
N65 M05
M07/M08 Coolant On
N_ M07 OR N_ M08
• The M07 and M08 commands switch on the coolant flow.
Example
%
:1010
N5 G90 G20
N10 M06 T12
N15 M10 (clamp workpiece)
N20 M03 S1000
M11 Clamps Off
N_ M11
Example
%
:1010
N5 G90 G20
………………………….
N80 M05
N85 M11 (Unclamp workpiece)
N90 M30
M30 Program End, Reset to Start
N_ M30
• The M30 code is used to stop a program. It also stops the spindle and
turns off the coolant. The program pointer will be reset to the first
block of the program and stop.
Example
%
:1012
N5 G90 G20
………………………….
N65 X0 Y0
N85 M05
N90 M30 (program end; reset to start)
M98 Call Subprogram
N_ M98 P_
Example
%
:1012
N5 G90 G20
/N10 M06 T03
/N20 G00 X0 Y0
……………………………………..
N85 M05
N90 M30
Comments
N_ (Comment statement)
Example
N 10 G00 Z0.5 (Rapid to Z0.5)
Example
% (program start flag)
:1087 (program number)
N5 G90 G20 G40 (Absolute, Inches, and compensation canceled)
N10 M06 T04 (Tool change to toll #4)
N15 M03 S2000 (Spindle on clockwise at 2000 rpm)
N20 G00 X2 Y-0.375 M08 (Rapid to X2, Y-0.375), coolant 2 on)
N25 Z-0.25 (Rapid down to Z-0.25)
N30 G01 Y0 F15 (Feed move to point #1 at 15 ipm)
N35 X0.5 Y0.5 (Feed move to point #2)
N40 Y3.0 (Feed move to point #3)
N45 G02 X2 I0.75 J0 (Circular feed move to point #4)
N50 G01 X3.5 (Feed move to point #5)
N55 G01 Y0.5 (Feed move to point #6)
N60 G02 X3 Y0 I-0.5 J0 (Circular feed move to point #7)
N65 G01 X2 (Feed move to point #1)
N70 G00 Z1 (Rapid to Z1)
N75 X0 M09 (Rapid to X0, coolant off)
N80 M05 (Spindle off)
N85 M30 (End of program)