You are on page 1of 23

Programming of Computer Numerically Controlled

Machines

By

Dr. Eng. Mostafa kamel


Basic Types of Numerically Controlled Machines

1. Numerical Control (NC)


In an NC system, the program is run from a punched tape:
It is impossible to store such a program in memory

1. Computer Numerical Control (CNC)


Machine with a CNC system are equipped with a computer,
Consisting of one or more microprocessors and storage facilities
2. What is Programming?
Technical Drawing

Machining technology

Tool selection

Preparation of program reading device

Machining
Machine Axes and Coordinate Systems

The positioning of a workpiece on a CNC machine

axis identification
coordinate systems
positioning systems
machine coordinates
work coordinates
Machine Axis Identification
Axis: a line segment used to orient a space or a geometric
object. It can be regarded as a reference line from which
distances or angles are measured in a coordinate system.
The Cartesian coordinate system is normally used to define
the movements on CNC machines.

Two types of axis


movement: linear
and rotary motion.
Z axis
The z-axis is always coincident with or parallel to the
axial centre line of the main machine rotating spindle.
+Z: the direction in which the tool moves away from the
workpiece.
X axis
The axis parallel to the longest dimension of the primary
machine table.
+X: +X movement is to the right when viewed from the
spindle axis with the observer facing the supporting
column (for vertical Z-axis).
+X movement is to the right when viewed from the spindle
axis in the direction of workpiece (for horizontal Z-axis).

View dir.
Primary Rotary Axes: A, B and C
A, B and C are used to indicate rotary motions about
the X, Y and Z axes, respectively. The thumb rule is
used to determine the direction of rotation. Many
CNC machining centers are characterized by three
linear axes and one rotary axis
Coordinate Systems

In CNC applications, two coordinate systems can be


used to identify the critical points that define a
workpiece: the Cartesian coordinate system and the
polar coordinate system.

Cartesian coordinate system: In single quadrant


positioning, preferred by many part programmers, all
position are located in the 1st quadrant.
Coordinate Systems
Polar coordinate system:
The angle is positive when
measured in the
counterclockwise direction
from the positive X axis.
Positioning System

Absolute positioning system

Incremental position system


Reference coordinate
Machine reference point:
Initial setup of the machine
As the reference point for other coordinate system
As the tool change position
Motion control is done by: servo-controlled motors

Table
Leadscrew
Encoder A/C Motor
~

Servo Controller

Counter Comparator

Input (converted from analog to digital value)


CNC terminology

BLU: basic length unit 


smallest programmable move of each axis.

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
Point-to-Point Tool Movements

Point-to-point control systems cause the tool to move to a point


on the part and execute an operation at that point only. The tool is
not in continuous contact with the part while it is moving. Drilling,
reaming, punching, boring and tapping are examples of point-to-
point operations.
Continuous-Path Tool Movements

Continuous-path controllers cause the tool to maintain continuous


contact with the part as the tool cuts a contour shape. These operations
include milling along any lines at any angle, milling arcs and lathe
turning.
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)


NC - Terminology

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

You might also like