0% found this document useful (0 votes)
139 views30 pages

4476 Writing A CNC Program

The document provides instructions for writing a CNC program to cut a light square into a piece of aluminum. It will outline the steps to [1] set up the coordinate system and tool offsets, [2] rapidly position the tool and cut the square using linear and circular interpolation motions, and [3] safely retract the tool at the end of the program. Key aspects covered include using absolute coordinates, setting work offsets, calling tools and offsets, performing rapids, linear cuts, and arcs using either IJK parameters or radius values. The goal is to cut a 3x3 square 1 inch from the corner of the aluminum block to a depth of 0.02 inches within specified tolerances.

Uploaded by

rlwersal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views30 pages

4476 Writing A CNC Program

The document provides instructions for writing a CNC program to cut a light square into a piece of aluminum. It will outline the steps to [1] set up the coordinate system and tool offsets, [2] rapidly position the tool and cut the square using linear and circular interpolation motions, and [3] safely retract the tool at the end of the program. Key aspects covered include using absolute coordinates, setting work offsets, calling tools and offsets, performing rapids, linear cuts, and arcs using either IJK parameters or radius values. The goal is to cut a 3x3 square 1 inch from the corner of the aluminum block to a depth of 0.02 inches within specified tolerances.

Uploaded by

rlwersal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Writing a CNC Program

Lecture Videos
Objective
Use a pointed engraving cutter to cut a light square into a piece of aluminum.
Workpiece: 5.0 wide by 2.0 tall by 6.0 long.
It will be mounted in a vise as shown in the next slide.

The square will be 3.0 x 3.0 (it will be offset 1.0 inches from the corner of the
workpiece).
Depth of the engraving: 0.020 inches deep.

The dimensional tolerance of the square is +/- 0.010 and the position tolerance
of the rectangle on the block is +/- 0.050.
Step 1 - Eliminate Assumption
Use a header to set
modal commands
that affect machine
motion and offsets.
This is the similar to the
standard mill header we will use
in this class.
G17 – Selects the plane in which arcs will be made.
G20 – Sets the units to inches.

G40 – Cancels cutter compensation. Cutter


compensation changes the position of the tool
based on its diameter.

G55 – Tells the controller where the origin


(0,0,0) is located on the machine.
G80 – Cancels canned cycles. Canned cycles
are a way to perform lots of steps by a single
command.
G90 – Tells the machine to use absolute
coordinates.
G94 – Feed rates are in units of distance per
minute. In this case, it is inches per minute.
G43 – Turns tool length compensation on. This
will allow the programmer to use tools that are
different lengths.
G90 & G91 - Absolute Vs. Incremental
Coordinates
G90 - Absolute
“Go to this point”

G91 - Incremental
“Go this far”
Step 2 – Establish The Coordinate System
Setting G54-G59 on the Controller
G54-G59 – Work Coordinate System Offsets

Setting the G55 X axis origin to be the edge of the part.


G54-G59 – Work Coordinate System Offsets

Setting the G55 Y axis origin to be the top edge of the part.
T and H – Tool Numbers and Length Offsets
Mills use a separate tool and tool offset address,
for example: T08 H08

Lathes use the T address to specify both tool


number and offset, for example: T101

Note: Calling a tool address does not change the


tool! That is done with an M06.
Setting Tool Length Offset
NOTE: This is a shortcut. It is a very inefficient
way of controlling tool lengths. We will look at
a better way of doing this in “Machine Setup
and Operation.”

This lecture is about programming. The


program would be identical.
Setting Tool Offset Length (shortcut)
G55 Z is ZERO

Tool Offsets Page

We’ll cover better ways of doing this later.

Now if Tool 8 is used with offset 8 (H8), Z


zero is the top of the part.
Turning the Spindle On and Off
M03 - On Clockwise
M04 - On Counterclockwise
M05 - Spindle Stop

M08 - Coolant On
M09 - Coolant Off
G0 or G00 Rapid
Step 3- Program Toolpaths Move

Let’s RAPID to the start location


About Rapids (G0 Moves) Rapids are NOT
Straight Lines!
Note: The tool could be anywhere
It is a good idea to add a safety move that
takes the Z straight up before any other moves
happen.

We don’t know if Z2.0 is up or down unless we


position the tool first.
G01 – Linear Cutting Move
Specifies a Destination - Cutting level
G01 – Linear Cutting Move
Continue around and back up
Step 4 – End Safely
Safely retract tool (usually Z up).

M02 - Program End (M30 is generally better)


or
M30 - Program stop and reset (stops spindle
and turns coolant off. Cancels tool length
offsets
G02 and G03 - Circular Interpolation
Circular interpolation at a given feedrate.
G02 Clockwise arc motion at feedrate.
G03 Counterclockwise arc motion at feedrate.

Like the G01 command, G02 and G03 require a feedrate (F) as well as destination (or distance)
coordinates (X, Y, and/or Z). The feedrate will default to the current feedrate if it has been
commanded previously in the program. For full circles, the X, Y and Z can be omitted (see I, J, K
Method below).
Lecture video on arcs STARTS HERE
Any of these can
G02 & G03 - I, J, K Method be omitted. It’s rare
to use K in this
class.

I is the distance from the ARC START to the ARC


CENTER in the X axis

J is the distance from the ARC START to the ARC


CENTER in the Y axis

K is the distance from the ARC START to the ARC


CENTER in the Z axis
I, J, K Method
Assume we are using the same header as before.
Notice the arc (p2 to p3 is CLOCKWISE = G2)

Notice Y of p3 is the same as the Y of p2 so it is omitted.

WHAT ARE I & J again?


I, J, K Method
Assume we are using the same header as before.
Notice the arc (p2 to p3 is CLOCKWISE = G2)

I is the distance from ARC START POINT to CENTER in the X axis.

J is the distance from ARC START POINT to CENTER in the Y axis.

Note: if I or J are zero, they can be omitted.


Avoid the dreaded “I J K ERROR”
NOTE:
For arcs to work, the math has to work to the
nearest ten-thousandths place.

OK!

NOT
OK!
I, J, K Example 2 - Full Circle
Sometime you have to use IJK
method. For instance, if you are
programming a full circle:

Would G3 work here?


R Method
Program the end point as before, but enter R value instead of I, J, K (Can’t use
them together).

Does any R value work here?

Lecture on R Method Starts HERE


R Method
What about the duplicate arc that this could mean?

The negative radius is a


convention to indicate the
larger (>180°) arc.

You might also like