You are on page 1of 66

NC PROGRAMMING

IE450 Manufacturing Systems

R. A. Wysk, Ph.D.
Agenda
Introduction
Types of NC Machines
Components of a NC Machine
Control Mechanisms
Interpolation
Software Components
Readings
Chapters 12-13 of Computer Aided
Manufacturing, Wang, H.P., Chang, T.C. and
Wysk, R. A., 3rd Edition ,2006. Chapter 9.
Objectives
To be able to know when and what type of NC
should be used
To be able to read and interpret an NC part
program
To be able to create NC part programs for milled
parts
To understand the difference between world,
machine and part coordinates
To understand how to set machine offsets
To execute an NC part program
HISTORICAL
15th century DEVELOPMENT
- machining metal.
18th century - industrialization, production-type machine tools.
20th century - F.W. Taylor - tool metal - HSS
Automated production equipment -
Screw machines
Transfer lines
Assembly lines
using cams and preset stops
Programmable automation -
NC
PLC
Robots
NEW NCs or CNCs
high speed spindle (> 40,000 rpm)

high feed rate drive ( > 600 ipm)

high precision ( < 0.00005" accuracy)


NC
MACHINES
Computer control
Servo axis control
Tool changers
Pallet changers
On-machine programming
Data communication
Graphical interface
Group Exercise

As a group, discuss how you could justify the


purchase of an NC machine.
What are the downsides for purchasing an
NC machine?
Besides direct labor reductions, what other
benefits come from NC machines?
Justification
Variance reduction
Time and quality
Eliminate direct labor
Produce increased part complexity
Contouring
Improve process efficiencies
NC
MACHINES unit
MCU - Machine control

Machine
MCU Tool
CLU - Control-loops unit

CLU
DPU DPU - Data processing
unit
NC MOTION-
CONTROL NC Program

Execution
Syst em

Dimensions Commands

Interpolator & T ranslat or


Servo-cont rol
Mechanism

Control Logic Power Relay

Linear Motion Solenoid


NC MACHINE
1. MotionCLASSIFICATIONS
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

5. Hardwired NC and softwired


Computer Numerical Control (CNC)
POINT TO
Moving at maximum ratePOINT
from point to point.

Accuracy of the destination is important but not the path.

Drilling is a good application.


CONTINUOUS

PATH
Controls both the displacement and the velocity.
Machining profiles.
Precise control.
Use linear and circular interpolators.
COMPONENTS OF AN NC MACHINE
TOOL translation axis control

Machine table Gear Tachometer


Position box
Controller resolver
Motor

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
Repeat abilit y

Avg. error

T est result
LEADSCREW
S
Converting the rotational motion of the motors to a linear motion.
Nut

Leadscrew

Pitch

pitch (p): the distance between adjacent screw threads


the number of teeth per inch (n):
n=1/p
BLU: Basic Length Unit (machine resolution)
BLU = p (inch/rev)) / N (sensor points/rev)
Where N is normally defined as the gain from a resolver or encoder.
Example
number of teeth per inch (n) = 20
n = 1 / p (teeth/in) = 0.05 in/rev
Resolver gain - N (sensor points/rev) = 200
pulses/rev
BLU = p (inch/rev)) / N (sensor points/rev)
= 0.05 in/rev / 200 pulses/rev
= 0.00025 inch
CONTROL
LOOPS
Open loop - No position feedback.
table

pulses motor

Use stepping motor.


CONTROL
LOOPS
A machine has 1 BLU = 0.001".To move the
table 5" on X axis at a speed (feed rate) of
6 ipm.
pulse rate = speed/BLU = 6 ipm/0.001
ipp= 6,000 pulse/min
pulse count = distance/BLU
= 5/0.001 = 5,000 pulses
CLOSED
LOOP
Differential
_ amplifier Shaft

Up-down + DC Tacho-
DAC Amp Motor meter Encoder
counter

+
Reference pulses

Closed-loop control mechanism


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
(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
Most common : linear and circular
S
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 y

SYSTEMS
y z

Right hand rule z x

Z axis align with the spindle - +Z moves


away from the workpiece or the spindle.
X axis - Lathe: perpendicular to the
spindle.
Horizontal machine: parallel to the table.
Vertical machine: +X points to the right.
MACHINE COORDINATES

Z X - Primary Feed axis


Z - Spindle axis
Y - Remaining axis

X
PROGRAM
Paper tape STORAGE
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.
Configurations
Machining centers
Turning centers
Machining Centers
High-Speed Spindles
30,000-rpm Spindle: The Haas 30K
spindle uses BT 30-taper tooling and
accepts tools up to 0.5" max diameter.
Hybrid ceramic angular-contact
bearings, an air/oil spot lubrication
system, and a spindle chiller ensure
superior accuracy and long bearing life.
The 30K spindle is available on VF-1
through VF-4 models. 10,000- and
15,000-rpm Spindles: A variety of 10K
spindles are available for Haas VF
models for 40- or 50-taper models,
with or without a gearbox. A 15K
spindle option is available for all 40-
taper, direct-drive VF models.
Machining Centers Continued
High-Speed Machining
The HSM option provides a powerful tool to
reduce cycle times and improve accuracy. Using a
motion algorithm called acceleration before
interpolation, combined with full look-ahead of
up to 80 blocks, HSM provides fast contouring
feeds without distortion of the programmed path.
The Haas HSM option accepts ISO standard G
code, and is a fraction of the cost of other high-
speed controls
Machining Centers
Through-Spindle Coolant
Optional TSC supplies coolant at up to 300 psi to the cutting edge, for
longer tool life, higher speeds, and improved deep hole drilling and
blind pocket milling as well as reduced cycle times. The exclusive
Haas design includes a special seal that disengages when the system is
not in use, which extends the life of the system. (Note: This system
provides 300 psi at a flow rate of 1.5 gallons per minute and 250 psi at
4 gpm. The actual pressure will vary with the diameter of the coolant
passages in the tool).
High-Pressure (1000 psi) TSC
Available on the VF Super Speed models and all 50-taper VF models,
high-pressure TSC makes it easier to perform deep-hole drilling and
heavy cuts, allows faster feedrates and provides better surface finishes.
Max flow rate is 6 gal/min at 1000 psi; max spindle speed is 10,000
rpm with the high-pressure TSC option enabled.
Machining Centers
Linear Scales
When absolute positioning accuracy is
necessary, linear scales are the only way to
ensure exact axis positioning under the
fluctuating conditions that exist in todays
machine shops. Linear scales ensure
positioning accuracy along X, Y and Z axes
by compensating for the thermal variations
inherent in all machine tools. With 2-micron
resolution, these scales deliver high
accuracy for the type of precision that mold
making and other high-tolerance machining
applications demand.
Machining Centers
Full 4th- and 5th-Axis Capabilities
Add a fully integrated Haas rotary table to your
VMC to create a supercharged machining
center: Program any angle, perform circular
cuts on the outside of your parts, or machine
complex contours such as impellers.
From the original HA5C collet indexer to the
HRT series to the TR series trunnion tables, a
Haas rotary is the industry benchmark. For
superior accuracy, Haas cuts the worm gear
while it's attached to the spindle, rather than
assembling the finished worm gear to the
spindle. And Haas rotary products run directly
from the machines control, for seamless
operation and uncomplicated programming.
Machining centers
Programmable Coolant Nozzle
P-Cool is a multi-position programmable
nozzle that automatically directs coolant
precisely at the part without having to open
the doors. The position of the nozzle is
controlled via the part program, saving
operator time by eliminating constant
adjustments and allowing unattended
operation. The nozzle can also be fine-tuned
from the control pendant while a program is
running.
Machining Centers
Auto Door
With this option, the machine doors open and close automatically via the part
program. This reduces operator fatigue during repetitive machining which
can increase operator productivity by up to 25% and allows for unattended
operation when used with a robotic loader.
Hard Drive & Ethernet Interface w/USB Support
This option provides tremendous flexibility in program transfer and
storage. The 20 GB hard drive supplies ample storage space for
program files, and the USB connection supports either a customer-
supplied ZIP drive or flash disk. The Ethernet component allows
quick and easy data transmission between your Haas machine and a
network or PC, and large files can be accessed by multiple machines.
High-speed data transfers allow DNC of large files at up to 1000
blocks per second. The Ethernet interface works with Windows XP,
ME, 2000 Pro & Server, NT 4.0, 98 and 95. IPX/SPX or TCP/IP
protocol; easy setup from the control screen.
Machining Center
Haas Probing Systems
ML PS 95/175 Laser Tool Monitor and Work Measure Upgrade Kit:
Upgrade to Marposs - This non-contact laser system allows for automatic tool length,
diameter measurement and breakage detection for tools from 0.008" to 6.8" in diameter.
The laser can be programmed to check tool profiles, monitor wear on multi-insert end
mills, and can update tool offsets and compensates for thermal variations. This kit
features IPC, Instant Productivity Cycles for quick and easy use on both laser tool setting
and work probe systems by anyone who can operate an edge finder and indicator. IPC
are defaulted program cycles that do not require approximate tool offset inputs or
descriptions for length and diameter measurements. IPC along with the work probe are
just as easy to use for setting work offsets and measuring and finding part features by
utilizing the wide range of defaulted programs. IPC features are many, fully defaulted
cycles or creative and program them yourself. This upgrade kit will reduce your set-up
times, while automatically updating your tool offset registers and more!
Machining Center
Machining Centers
Turning Centers
Workpiece rotates and tool stays stationary normally
horizontal.
Turning Centers
Haas Servo Bar 300
Designed to boost productivity and
streamline turning operations, this
servo-driven bar feeder is built by
Haas exclusively for Haas CNC
lathes. It runs directly from the
Haas control, making it the only
smart bar feeder on the market.
Unique features make setup and
operation simple, like a large
access door for spindle liner
change-out and a single adjustment
for setting bar diameter. All bar
feed parameters are set at the lathe
control.
Turning Centers
Live Tooling
The live tooling option for Haas lathes
allows you to use standard VDI 40 axial
or radial driven tools to perform
secondary operations such as milling,
drilling, flatting and tapping both on
the face of the part and around the
diameter. This option includes a full C
axis, which provides interpolated
bidirectional motion at precise speeds
and feeds for part positioning and
repeatability. A powerful hydraulic
brake locks the main spindle during
secondary operations, and disengages
for turning and indexing.
Live tooling is not available with a
standard bolt-on style tool turret. It is
only available with the VDI or VB
Hybrid turret.
Turning Centers
Steady Rest Provision
The Haas steady rest platform provides
increased support for turning and boring
long shafts on SL-30 and SL-40 lathes. It
features industry-standard mounting
holes to accept a variety of aftermarket
automatic hydraulic steady rests.
Hydraulic power is provided by the lathe,
and the gripper is activated by M code.
*The steady rest provision does not
include the gripper. Minimum and
maximum part diameters are dependent
on the size and style of gripper unit
mounted on the platform. Minimum and
maximum travel limits are measured
from the spindle bulkhead, and do not
include chuck dimensions or other
workholding.
Turning Center
Parts Catcher
For bar feed applications,
or when using a bar puller,
the parts catcher rotates
into position to catch the
finished part and direct it
into a bin located on the
front door. Theres no
need to stop the machine
and open the door to
retrieve parts.
Turning Centers
Tool Presetter
The manual tool-probe
arm swings down for
fast tool setting. Touch
the tool tip to the
probe and offsets are
automatically entered.
Turning Centers
Turning Centers
Resource
PrimarysReference:
Chang T-C., Wysk, R. A., and Wang, H-P., Computer
Aided Manufacturing, Prentice Hall International Series
in Industrial and Systems Engineering, 2006, Upper Saddle
Valley, NJ 07458. ISBN 0-13-754524-X Chapter 12

http://www.haascnc.com/
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 PART
Example 9.1
PROGRAMMING
Machined from a 5" x 4" x 2" workpiece. low carbon steel.
The process plan:
1. Set the lower left bottom corner of the part as the machine zero point
(floating zero programming).
2. Clamp the workpiece in a vise.
3. Mill the slot with a 3/4" four flute flat end mill made of carbide. From the
machinability data handbook, the recommended feed is 0.005
inch/tooth/rev, and the recommended cutting speed is 620 fpm.
4. Drill two holes with a 0.75" dia twist drill. Use 0.18 ipr feed and 100 fpm
speed.
PART
2 holes 0.750.001

DRAWING
.75 0.001 M
MA BC

4.000
R1.000

3.000

2.000

1.000

A 1.75
3.000
B
5.000

.500

2.000

All dimension in inches. A ll tolerance 0.001"


SOLUTION TO
Solution:
EXAMPLE
The cutting parameters need be converted into rpm and ipm.

Milling: RPM = 12 V = 12 x 620 fpm = 3,157 rpm


D 0.75 inch

12 x 100 fpm
12 V
RPM =
D
=
0.75 inch = 509 rpm
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)

Drill End mill

Vise jaw

(0,0,0)
CUTTER
The coordinates of each point (cutter location) are calculated below:
LOCATIONS
p1': ( 1.75+0.375, -0.1-0.375, 4.00) = (2.125, -0.475, 4.000)
p1: (2.125,-0.475, 2.000-0.500) = (2.125,-0.475,1.500)
p2: (2.125,4.000+0.100,1.500) = (2.125,4.100,1.500)
p3: (3.000-0.375,4.100,1.500) = (2.625,4.100,1.500)
p4: (2.625,1.375,1.500)
p5: (3.000,2.000-1.000+0.375,1.500) = (3.000,1.375,1.500)
p6: (3.000,2.625,1.500)
p7: (3.000,2.000,1.500)
p8: (2.625,2.000,1.500)
p9: (2.625,-0.100,1.500)
p9': (2.625,-0.100,4.000)
PART PROGRAM
Part program Explanation
N0010 G70 G 90 T08 M06 Set the machine to inch format
and absolute dimension programming.

N0020 G00 X2.125 Y-0.475 Z4.000 S3157 Rapid to p1'.

N0030 G01 Z1.500 F63 M03 Down feed to p1, spindle CW.

N0040 G01 Y4.100 Feed to p2.

N0050 G01 X2.625 To p3.

N0060 G01 Y1.375 To p4.


PART PROGRAM
Part program Explanation

N0070 G01 X3.000 To p5.


N0080 G03 Y2.625 I3.000 J2.000 Circular interpolation to p6.
N0090 G01 Y2.000 To p7.
N0100 G01 X2.625 To p8.
N0110 G01 Y-0.100 To p9
N0120 G00 Z4.000 T02 M05 To p9', spindle off, tool #2.
N0130 F9.16 S509 M06 Tool change, set new feed and
speed.
N0140 G81 X0.750 Y1.000 Z-0.1 R2.100 M03 Drill hole 1.
N0150 G81 X0.750 Y3.000 Z-0.1 R2.100 Drill hole 2.
N0160 G00 X-1.000 Y-1.000 M30 Move to home position, stop
the machine.
CNCS
VERIFICATION
CNCS 3D
DRAWING
Offsets
Fixture
G10, G54, G54.1
Diameter
Tool
Length compensation
Part-Edge compensation
Cutter Compensation Next Slides
Others Discussed in Lab Exercises (Simulators)
Tool Radius Compensation
Cutter Compensation
Shifting tool path so that the actual finished cut is either
moved to the left or right of the programmed path.
Normally, shifted exactly by tool radius
Tool Entry and Exit Issues
Where you should be
You should know how an NC machine
works
You should be able to create an NC
program using MasterCAM
You should be able to read an NC program
and understand what the machine will do
You should be safe in the FAME lab using
NC machines

You might also like