NC Programming
NC Programming
• http://www.engr.psu.edu/cim/ie4
50/mllwrkbk.pdf
Exercise
Readiness Assessment Test A.K.A.
RAT
AS A INDIVIDUAL,
INDIVIDUAL prepare a detailed
response for the Readiness
Assessment test found on the web
http://www.engr.psu.edu/cim/ie450/ie450r
at3.doc
(ratNC.doc in this module directory)
CLU
DPU
DPU - Data processing
unit
NC MOTION-
CONTROL NC Pro g ra m
Exe c u t io n
Sy s t e m
Dim e n s io n s Co m m a n d s
In t e rp o la t o r & T r a n s la t o r
Se rvo -c o n t ro l
Me c h a n is m
Co n t ro l Lo g ic Po we r Re la y
Lin e a r Mo t io n S o le n o id
NC MACHINE
CLASSIFICATIONS
1. Motion control:
point to point (PTP)
continuous (contouring) path
2. Control loops:
open loop
closed loop
3. Power drives:
hydraulic, electric,or pneumatic
NC MACHINE
CLASSIFICATIONS
4. Positioning systems:
incremental
absolute positioning
Leadscrew
Servo
drive
Magnetics control
cabinet
NC MACHINE
• Accuracy
RATING
• Repeatability
• Spindle and axis motor horsepower
• Number of controlled axes
• Dimension of workspace
• Features of the machine and the
controller.
NC
•ACCURACY
Accuracy = control instrumentation
resolution and hardware accuracy.
• Control resolution: the minimum
length distinguishable by the control
unit (BLU).
• Hardware inaccuracies are caused by
physical machine errors.
HARDWARE
INACCURACIES
Component tolerances:
inaccuracies in the machine elements,
machine-tool assembly errors, spindle
runout, and leadscrew backlash.
Machine operation:
Tool deflection (a function of the cutting
force), produces dimensional error and
chatter marks on the finished part.
HARDWARE
INACCURACIES
Thermal error:
heat generated by the motor operation,
cutting process, friction on the ways and
bearings, etc. Use cutting fluids, locating
drive motors away from the center of a
machine, and reducing friction from the
ways and bearings
REPEATABILIT
Y
Programmed position
Repeatability
Avg. error
Test result
LEADSCREW
S
Converting the rotational motion of the motors to a linear motion.
Nut
Leadscrew
Pitch
pulses motor
Up-down + DC Tacho-
DAC Amp Motor meter Encoder
counter
+
Reference pulses
(10,5) (10,5)
(3,2) (3,2)
X X
Point-to-point control path Linear path
(10-3) 7
Vx =6 = 6 = 5.5149
2
(10-3) + (5-2) 2 49+ 9
(5-2) 3
Vy =6 = 6 = 2.3635
2
(10-3) + (5-2) 2 49+ 9
INTERPOLATOR
• S and circular
Most common : linear
• Since interpolation is right above the servo
level, speed is critical, and the process
must not involve excessive computation.
• Traditional NC interpolators: Digital
Differential Analyzer (DDA)
• Higher order curves, such as Bezier's
curve, use off-line approximation
algorithms to break the curves into linear
or circular segments.
COORDINATE
SYSTEMS y z
y
X
PROGRAM
• STORAGE
Paper tape
Paper or Mylar coated paper.
• Diskettes
• From other computers through RS 232 or
local area network (LAN)
SYMBOLIC
• ASCII
CODES
or ISO, use even parity
• EIA - Binary Coded Decimal (BCD), RS
244A standard, use odd parity.
TAPE INPUT
• EIA RS-274FORMATS
standard
• Word-address format
N0010 G01 X07500 Y06250 S612
Resource
sReference:
• Primary
Chang T-C., Wysk, R. A., and Wang, H-P., “Computer
Aided Manufacturing”, Prentice Hall International Series
in Industrial and Systems Engineering, Upper Saddle
Valley, NJ 07458. ISBN 0-13-754524-X
Agenda
• Introduction
• Absolute and Incremental Programming
• Elements of NC Program
• NC Words (G, M, T, S, … Codes)
• Examples
• Cutter Compensation and Offsets
• Examples
• Conclusions
Introduction to NC
programming
• Manual part programming
• Computer-assisted part programming
• Formats
– Fixed-Address
– Tab-Sequential
– Word-Address
Manual NC
programming
• Absolute Programming
• Incremental Programming
• Example (on Board)
Basic Elements of NC Program
• Blocks of Commands
• NC Words
• NC Function ~ NC word(s)
• Several Functions in one block
• When viewing, a block is same as a line of text
• Pre-defined Terminator
• Optional Blocks
NC WORDS
Full circle ON
(5.000,4.000) ? destination
sequence no.
center
N0100 G02 X7.000 Y2.000 I5.000 J2.000
(7.000,2.000)
(5.000,2.000)
NC WORDS- F and S
• F Code. feed speed.
inch/min (ipm), or ipr. Codes
• F code must be given before either G01, G02, or G03 can be used.
• Example:
N0100 G02 X7.000 Y2.000 I5.000 J2.000 F6.00
• N0010 S1000
NC WORDS- T and R Codes
• T Code. tool number. (1,2,2)
1
Actual tool change does not Initial height
DRAWING
.7 5 ø0 .0 0 1 M
MA B C
4 .0 0 0
R1 .0 0 0
3 .0 0 0
2 .0 0 0
1 .0 0 0
A 1 .7 5
3 .0 0 0
B
5 .0 0 0
.5 00
2.0 0 0
12 x 100 fpm
12 V
RPM = = 0.75 inch = 509 rpm
D
Drilling:
Vf = f RPM = 0.018 ipr x 509 rpm = 9.16 ipm
SETUP AND CUTTER
PATH p2 p3
H2 p6
p7
p8
H1
p4 p5
p9
p1
(0,0,0)
Vise jaw
(0,0,0)
CUTTER
LOCATIONS
The coordinates of each point (cutter location) are calculated below:
N0030 G01 Z1.500 F63 M03 Down feed to p1, spindle CW.
G42
G41 (or G42) and G01 in separate blocks the compensation is effective from
the start.
N0010 G41 G41
(1.5, 2.0)
N0010 G41
G42
N0020 G01 X1.500 Y2.000
N0030 G01 X0.000 Y1.600
(0, 1.6)
(2.000, 1.700)
2.000
2.000
(6,6)
PART
Part Program PROGRAM
Explanation
N0010 G41 S1000 F5 M03 Begin compensation, set feed and speed, spindle on
N0020 G00 X6.000 Y6.000 Move to lower left corner
N0030 G01 Z-1.000 Plunge down the tool
N0040 Y8.000 Cut to upper left corner
N0050 X8.000 Cut to upper right corner
N0060 Y6.000 Cut to lower right corner
N0070 X6.000 Cut to lower left corner
N0080 Z1.000 Lift the tool
N0090 G40 M30 End compensation, stop the machine
Exercise
• Complete the exercise on setting up an
NC machine. The exercise can be found
at
http://www.engr.psu.edu/cim/ie450/ie450as2.do
c
TURNIN
2.875
G
.250
.625
1.125
R.125
1.000 Z
2.125
2.875 X
Part design
Cutter path
TURNIN
Programming tool point
G
No compensation needed.
Surfaces cut
Programmed
tool path
Surface created
COMPUTER ASSISTE PART
PROGRAMMING
Machine-oriented languages - machine
specific
General-purpose languagesPart
- program
use post
processors to generate
Language
machine specific code Processor
CL data