Programming Methods - Lecture Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

CAM/CAM

PROGRAMMING METHODS
Numerical Control (NC) Defined

Programmable automation in which the mechanical actions of a ‘machine


tool’ are controlled by a program containing coded alphanumeric data
that represents relative positions between a work head (e.g., cutting
tool) and a work part

Program Machine
Instructions Control Unit

Transformation
Process
Power
Controller components

Controller: (Machine Control Unit, MCU) ➔


Electronic and computerized interface between operator and m/c

Controller components:
1. Data Processing Unit (DPU)
2. Control-Loops Unit (CLU)
Controller components

Data Processing Unit:


Input device [RS-232 port/ Tape Reader/ Punched Tape Reader]
Data Reading Circuits and Parity Checking Circuits
Decoders to distribute data to the axes controllers.

Control Loops Unit:


Interpolator to supply machine-motion commands between data points
Position control loop hardware for each axis of motion
Types of CNC machines

Based on Motion Type:


Point-to-Point or Continuous path

Based on Control Loops:


Open loop or Closed loop

Based on Power Supply:


Electric or Hydraulic or Pneumatic

Based on Positioning System


Incremental or Absolute
Open Loop vs. Closed Loop controls
Motion Control Systems

Point-to-Point systems
 Also called position systems
 System moves to a location and performs an
operation at that location (e.g., drilling)
 Also applicable in robotics

Continuous path systems


 Also called contouring systems in machining
 System performs an operation during movement
(e.g., milling and turning)
INTERPOLATION

Control multiple axes simultaneously to move on a line,


a circle, or a curve.
Y Y

(10,5) (10,5)

(3,2) (3,2)
X X
Point-to-point control path Linear path
Interpolation Methods

1. Linear interpolation
 Straight line between two points in space

2. Circular interpolation
 Circular arc defined by starting point, end point, center or radius, and
direction
Absolute vs. Incremental Positioning

Absolute positioning
Move is: x = 40, y = 50

Incremental positioning
Move is: x = 20, y = 30.
Introduction to NC programming

 Manual part programming


 Computer-assisted part programming
 Part programming directly from a CAD database
Manual Part Programming

• The part programmer, without computer aids, records NC blocks

• A Flexwriter is used to produce the punched tape


Manual NC programming

Part program: A computer program to specify

- Which tool should be loaded on the machine spindle;

- What are the cutting conditions (speed, feed, coolant ON/OFF etc)

- The start point and end point of a motion segment

- how to move the tool with respect to the machine.

Standard Part programming language: RS 274-D (Gerber, GN-code)


History of CNC

The RS274-D is a word address format

Each line of program == 1 block

Each block is composed of several instructions, or (words)

Sequence and format of words:

N3 G2 X+1.4 Y+1.4 Z+1.4 I1.4 J1.4 K1.4 F3.2 S4 T4 M2

sequence no destination coordinates dist to center of circle tool

feed rate spindle speed


preparatory function
miscellaneous function
NC WORDS – G codes

Table 9.1 G codes


g00 Rapid traverse g40 Cutter compensation - cancel

N code. g01 Linear interpolation g41 Cutter compensation - left


sequence *
g02 Circular interpolation, CW g42 Cutter compensation -right
number
example: g03 Circular interpolation, CCW g70 Inch format

N0010 g04 Dwell * g71 Metric format

G code. g08 Acceleration g74 Full circle programming Off


preparatory
g09 Deceleration g75 Full circle programming On
word.
g17 X-Y Plane * g80 Fixed cycle cancel
*
g18 Z-X Plane g81 -9 Fixed cycles

g19 Y-Z Plane g90 Absolute dimension


* programming
g33 Thread cutting, constant lead g91
Incremental deimension
g34 Thread cutting, increasing programming
Manual Part Programming Example

5”
2.5”
p4
p2 p3 p5

1”

Tool size = 0.25 inch,


5” Feed rate = 6 inch per minute,
Cutting speed = 300 rpm,
Tool start position: 2.0, 2.0
Programming in inches
45°

(4, 4)
p1 Motion of tool:
p0 → p1 → p2 → p3 → p4 → p5 → p1 → p0
p0 (2, 2)
1. Set up the programming parameters

5”
2.5”
p4
p2 p3 p5

1”

Programming in inches
5”
Use absolute coordinates

Feed in ipm
45°
N010 G70 G90 G94 G97 M04
(4, 4)
p1
Spindle speed in rpm
p0 (2, 2)
Spindle CCW
2. Set up the machining conditions

5”
2.5”
p4
p2 p3 p5

1”
Machine moves in XY-plane

Use full-circle interpolation


5”
Feed rate

Spindle speed
45°
N020 G17 G75 F6.0 S300 T1001 M08
(4, 4)
p1
Tool no.
p0 (2, 2)
Flood coolant ON
3. Move tool from p0 to p1 in straight line

5”
2.5”
p4
p2 p3 p5

Linear interpolation
1”
target coordinates

5” N030 G01 X3.875 Y3.698

45°

(4, 4)
p1

p0 (2, 2)
4. Cut profile from p1 to p2

5”
2.5”
p4
p2 p3 p5

1”

Linear interpolation
5” target coordinates

N040 G01 X3.875 Y9.125


45°
or
(4, 4)
p1 N040 G01 Y9.125

p0 (2, 2)
X-coordinate does not change ➔ no need to program it
5. Cut profile from p2 to p3

5”
2.5”
p4 Linear interpolation
p2 p3 p5

target coordinates
1”

N050 G01 X5.634 Y9.125

5”
y = 9 + 0.125 = 9.125
(6.5 - x)2 + 0.1252 = (1 - 0.125)2
x = 5.634
p3
(x, y)
45°

(6.5, 9)
(4, 4) .125
p1

p0 (2, 2)
1”
6. Cut along circle from p3 to p4

5”
2.5”
p4
p2 p3 p5

1”

circular interpolation, CCW motion

5”
target coordinates

45° N060 G03 X7.366 Y9.125 I6.5 J9.0

(4, 4)
coordinates of center of circle
p1

p0 (2, 2)
7. Cut from p4 to p5

5”
2.5”
p4
p2 p3 p5

1”

5”

Linear interpolation

45° target coordinates (Y is unchanged)

(4, 4) N070 G01 X9.302


p1

p0 (2, 2)
8. Cut from p5 to p1

5”
2.5”
p4
p2 p3 p5

1”

5”
Linear interpolation

target coordinates (see step 3)


45°
N080 G01 X3.875 Y3.698
(4, 4)
p1

p0 (2, 2)
9. Return to home position, stop program

5”
2.5”
p4
p2 p3 p5

1”

Linear interpolation

5” target coordinates (see step 3)

N090 G01 X2.0 Y2.0 M30

45°
end of data
(4, 4)
N100 M00
p1

p0 (2, 2) program stop


Computer-Assisted Part Programming

 Write machine instructions using natural language


type statements
 Statements translated into machine code of the
MCU
 APT (Automatically Programmed Tool) Language
Sample Statements

 Part is composed of basic geometric elements and


mathematically defined surfaces
 Examples of statements:
P4 = POINT/35,90,0
L1 = LINE/P1,P2
C1 = CIRCLE/CENTER,P8,RADIUS,30

 Tool path is sequence of points or connected line and


arc segments
 Point-to-Point command: GOTO/P4
 Continuous path command: GOLFT/L1,TANTO,C1
Automatic Part Programming
Software programs can automatic generation of CNC data

Define Tool

CNC data

Make 3D model
Simulate
cutting
Automatic part programming and DNC

Very complex part shapes ➔ very large NC program

NC controller memory may not handle HUGE part program

computer feeds few blocks of


NC program to controller

When almost all blocks executed,


controller requests more blocks
Summary

CNC machines allow precise and repeatable control in machining

CNC lathes, Milling machines, etc. are all controlled by NC programs

NC programs can be generated manually, automatically

Additional references: RS274D code descriptions

You might also like