You are on page 1of 46

3.

Numerical control (NC)


NC is a form of programmable automation in which the mechanical actions of a machine are controlled by a program containing coded alphanumeric data. The data represent relative positions between a work-head (cutting tool) and a work-part (object being processed). The program of instructions can be changed to process a new job. The capability to change the program, makes NC suitable for low and medium production. The application of NC has two categories:

1. Machine tool applications, such as drilling, milling, turning, and other metal working; and 2. Non-machine tool applications, such as assembly, drafting and inspection.

3.1 Introduction to NC and CNC


3.1.1 Basic Components of an NC System An NC system consists of three basic components: I. The program of instructions is step-by-step commands that direct the actions of the equipment - part program that refer to positions of a cutting tool relative to the worktable (fixture) with spindle speed, feed rate, cutting tool selection, and other functions.

II.

The machine control unit (MCU) consists of a microcomputer and related control hardware that stores instructions and executes it by converting each command into mechanical actions of the equipment, one command at a time. The related hardware includes

components to interface with the processing equipment and Feedback control elements. The MCU also includes one or more Reading devices for entering part programs into memory.

III.

The processing equipment accomplishes the processing steps to transform the starting workpiece into a completed part. Its operation is directed by the MCU.

3.1.2 Computer Numerical Control (CNC) CNC can be defined as an NC system whose MCU is based on a dedicated microcomputer rather than on a hard-wired controller, which is resulted from size and cost significant reduction of digital computers and substantial increase in their computational capabilities. Features of CNC The additional features of CNC System include: sufficient capacity to Store of more than one part program multiple data entry capabilities for Various forms of program input (punched and magnetic tape, diskette, RS-232 communications, manual data input)

Program editing at the machine tool (testing and correcting a program at the machine site),. Fixed cycle and programming subroutines: to store frequently used machining cycles as macros that can be called by the program Interpolation: Positioning features for setup: facilitated alignment task can be using certain features Cutter length and size compensation: Acceleration and deceleration calculations.

Communications interface with other computers/ computer-driven devices such as:


(1) Downloading part programs from a central data file, (2) Collecting operational data, (3) Interfacing with peripheral equipment,

Diagnostics: monitors and detect certain aspects of the machine tool malfunctions. Common CNC diagnostics system are:
Control start-up diagnostics, Malfunction and failure analysis, Extended diagnostics for individual components, Tool life monitoring, Preventive maintenance notices, Programming diagnostics

The MCU for CNC consists of five elements which are interconnected by means of a system bus.
Memory -ROM -Operating sys -RAM -Part programs Central processing unit (CPU) Input/output interface -Operator panel -Tape reader

System bus Machine tool controls -Position control -Spindle Speed control Sequence controls -Coolant - Fixture clamping -Tool changer

Fig. Configuration of CNC machine control unit

Direct Numerical Control (DNC) DNC involves the control of a number of machine tools by a single (mainframe/ Central) computer. A program is transmitted directly to MCU at a time and on demand; The system consists of: Central computer (CC), Bulk memory at CC site, Set of controlled machines and Telecommunications lines linking machines with CC. In operation, the computer calls the required part program from bulk memory and sent it (one block at a time) to the designated machine tool. The CC also receives feedback from the machines to indicate operating performance in the shop. Thus, a central objective of DNC was to achieve two-way communication between the machines and the CC.

Distributed Numerical Control In the new DNC configuration, CC is connected to MCUs, which are themselves computers. This permits complete part programs to be sent to the machine tools, rather than one block at a time. Redundant computers improve system reliability compared with the original DNC. The two-way information communication flow are:
Table: Flow of Info b/n Central Computer (CC) and M/c Tools in DNC
Data & Info Down loaded from CC to M/c & Shop Floor NC part programs Machining cycle time for part program List of tools needed for job Data about when program was last used Machine setup instructions Data & Info Loaded from M/c & Shop Floor to CC Piece counts Actual machining cycle times Tool life statistics M/c up/down time statistics for m/c utilization and reliability assessment Product quality data

The two ways to configuring a DNC system are: I. Switching network, uses a data switching box to make a connection from the CC to a given CNC machine for downloading part programs or uploading data. This limits the number of machines in the DNC system that depend on part program complexity, frequency of service required, and capabilities of the CC.
DNC Computer

MCU

MT Data switching box

MCU

MT

MCU

MT MCU MT

MCU

MT

ii.

LAN. In centralized structure arrangement, the computer system is organized as a hierarchy, with the central (host) computer coordinating several satellite computers that are each responsible for a number of CNC machines. Local area networks in different sections and departments of a plant often interconnected in plant-wide and corporate-wide networks Each type has several possible variations.
DNC Computer

Satellite Computer

Satellite Computer

MCU

MT

MCU

MT

MCU

MT

MCU

MT

3.1.3 Application of NC
The operating principle of NC has many applications. The applications divide into two categories: machine tool applications (those usually associated with metal work industry) and non-machine tool applications (diverse group of operations in other industries). I. Machine Tool Applications The most common applications of NC are in machine tool control which was the first application of NC and is still important. Machining Operations and NC Machine Tools. Machining is a mnfg process in which the geometry of the work is produced by removing excess material. By controlling the relative motion between a cutting tool and the workpiece, the desired geometry is created.

There are four common types of machining operations: (a) Turning, (b) Drilling, (c) Milling, (d) Grinding.

Each of the four machining operations are carried out at a certain combination of speed, feed, and depth of cut, collectively called cutting conditions. The common NC machine tools with their typical features are:
NC lathe requires two-axis, continuous path control, either to make straight or contour turning. NC boring mill requires continuous path, two-axis control for creating internal cylinder NC drill press use point-to-point control of the spindle/ drill bit) and two axis (x-y) control of the worktable. Some NC drill presses have turrets containing six or eight drill bits. NC milling machine require continuous path control to perform straight cut or contouring operations. Cylindrical grinder has continuous path two-axis control, similar to an NC lathe.

NC Application Characteristics
characteristics that are most suited to NC application are: Batch production: NC is appropriate in small/ medium lot sizes as dedicated automation and Manual production would be uneconomical for these quantities. Repeat orders: Batches of the same parts are produced at random or periodic intervals. Complex part geometry. such as those found on airfoils and turbine blades, circles and helixes. Much metal needs to be removed from the work part: complex part geometry to fabricate large structural sections with low weights. Many separate machining operations on the part: features requiring different cutting tools, such as drilled and/or tapped holes, slots, flats, and so on. The part is expensive. When the part is expensive, and mistakes in processing would be costly .

NC for Other Metalworking Processes include: Punch presses for sheet metal hole punching. Presses for sheet metal bending. Welding machines. Both spot and continuous arc welding Thermal cutting Machines, oxy-fuel, laser, plasma arc cutting. Tube bending machines to control location and angle of bend such as frames for bicycles. II. Other NC Applications The principle of NC has a host of other applications, which are not always referred to "numerical control. Some of NCtype controls are: Wire wrap machines Component insertion machines Drafting machines Coordinate measuring machine Tape laying machines for polymer composites Filament winding machines for polymer composites

Advantages and Disadvantages of NC


Advantages of NC Nonproductive time is reduced Greater accuracy and repeatability. Lower scrap rate. Inspection requirements are reduced. More complex part geometries are possible. Engineering changes can be accommodated more gracefully, Simpler fixtures are needed, Shorter manufacturing lead times. Reduced parts inventory, Less floor space required. Operator kill-level requirements are reduced, Disadvantages of NC. Higher investment cost. Higher maintenance effort. Part programming. Higher utilization of NC equipment

3.2 NC RART PROGRAMMING


NC part programming consists of planning and documenting the sequence of processing steps to be performed on an NC machine. The programmer must have knowledge of machining or other processing technology as well as geometry and trigonometry. Part programming uses a variety of procedures ranging from highly manual to highly automated methods. The methods are:
1. 2. 3. 4. Manual part programming, Computer-assisted part programming, Part programming using CAD/CAM, and Manual data input.

3.2.1 Manual Part Programming In manual part programming, the programmer prepares the NC code using the low-level machine language previously described. The part program is a block-byblock listing of the machining instructions for the given job, formatted for the particular machine tool, most suited for point-to-point machining. In preparing the NC part program, the part programmer must initially define the origin of the coordinate axes and then reference the succeeding motion commands to this axis system. This is accomplished in the first statement of the part program.

The important definition in the program are are: 1. NC Coding Systems 2. NC Coordinate System 3. Motion Control Systems

1. NC Coding System The program of instructions is communicated to the machine tool using a coding system. This NC coding system is the low-level machine language that can be understood by the MCU. Words in an instruction block are intended to convey all of the commands and data needed for the machine tool to execute the move defined in the block. The words in a block are usually given in the following order:
Sequence number (N-word) Preparatory word (G-word); Coordinates (X-, Y-, Z-words for linear axes, A-, B-, C-words for rotational axis Feed rate (F-word) Spindle speed (S-word) Tool selection (T -word) Miscellaneous command (M-word); see the table for definition of M-words) End-of-block (EOB symbol)

G-words or preparatory words consist of two numerical digits with "G" prefix that prepare the MCU for the instructions and data contained in the block so that the subsequent data can be properly interpreted. In some cases, more than one G-word is needed. M-words are used to specify miscellaneous or auxiliary functions that are available on the machine tool such as starting and stopping the spindle rotation, turning the cutting fluid on or off.

Common Word Prefixes Used in Word Address Format


Word Prefix Example
N G X, Y, Z U, W A, B, C N01 G21 X75.0 U25.0 A90.0

Function
Sequence number; Preparatory word; Coordinate data for three linear axes Coor. data for incremental moves in turning Coor. data (deg) for rotational axes x; y ; and z.

R
I, J, K. F S T D P M

R100.0
I32 J67 G94 F40 S0800 T14 005 P05 R15.0 M03

Radius of arc; in circular interpolation. It can also be used to cutter radius


Coord. values of arc center, in circular interpolation Feed rate per minute or per revolution Spindle speed in rpm or %age of max. speed Tool selection, in m/cs with auto tool changer. Tool dia. in contouring moves for offsetting Used to store cutter radius data in offset register number. Miscellaneous command

TABLE - Common G-words (Preparatory Word) G-word G00 G01 G02; G03 G04 G10 G17; G18; G19 G20 G28 G32 G41, G42 G50 G90; G91 G94, G95 G98; G99 Function P-t-p movement (rapid) b/n previous point and end point Linear interpolation movement. Circular interpolation, clockwise counterclockwise respectively. Dwell for a specified time Input of cutter offset data, followed by a P-code and an R-code. Selection of x-y, x-z and y-z plane in milling respectively. Input values specified in inches Return to reference point. Thread cutting in turning. Cutter offset compensation, left and right of part surface rspvly. Specify location of origin relative to starting location of tool. Programming in absolute incremental coordinates respectively. Specify feed/minute and feed/revolution respectively Specify feed/minute and feed/revolution respectively in turning.

Common M-words Used in Word Address Format


M-Word
M00; M01 M02 M03; M04

Function
Program stop; and Optional program stop respectively End of .program. Machine stops Start spindle in clockwise and counterclockwise direction respectively .

M05
M06 M07; M08; M09 M10; M11 M13; M14 M17 M19 M30

Spindle stop
Execute tool change, either manually or automatically. Turn cutting fluid on flood, on mist and off respectively . Automatic clamping and unclamping of fixture, machine slides, etc respectively. Start spindle in clockwise and counterclockwise direction and turn on cutting fluid respectively. Spindle and cutting fluid off. Turn spindle off at oriented position. End of program. Machine stop.

2. NC coordinate system Programming of NC machine tools consists of little more than specifying a sequence of x- y coordinates. The origin of coordinate axis system is located at the corners or center of symmetry, then the operator indicates to the MCU about the origin for subsequent tool moves. To program the NC equipment, there are two axis systems For flat and prismatic workparts The axes are three linear axes (x, y, z) and three rotational axes (a, b, c), to specify angular positions and orient workpart or tool For Rotational parts - are associated with NC lathes and turning centers. The path of the cutting tool relative to the rotating workpiece is defined in the x-z plane.

3. Motion Control Systems


Some processes are performed at discrete locations (e.g., drilling, spot welding) and others are carried out while workhead is moving (e.g., turning, arc welding). NC Motion control systems are two: (1) Point-to-point / positioning systems; Move the worktable to a programmed location without regard for the path taken and some processing action is accomplished at the location. Thus, the program consists of a series of point locations. (2) Continuous path systems refer to continuous simultaneous control of two or more axes, which controls tool trajectory relative to the workpart, thus enabling to generate angular surfaces, 2-D curves, or 3-D contours. It can be straight-cut or contouring

EXAMPLE Point-to-Point Drilling

Fig. Aluminum Sample part for NC part programming

This example presents the NC part program for drilling the three holes in the sample part. The x-, y-, and z-axes are defined. The program begins with the tool positioned at at x = 0, y = -50, and z =10 (target point). NC Part Program Code Comment N001 G21 G90 G92 X0 Y-050.0 Z0.10.0; Define origin of axes. N002 G00 X070.0 Y030.0; Rapid move to first hole location. N003 G01 G95 Z-15.0 F0.05 Sl000 M03; Drill first hole. N004 G01 Z010.0; Retract drill from hole. N005 G00 Y060.0; Rapid move to second hole.

N006 G01 G95 Z-15.0 FO.05; N007 G01 Z010.0; N008 G00X120.0 Y030.0; N009 G0l G95 Z-15.0 F0.05; N0l0 G0l Z0l0.0; N0ll G00 X0 Y-050.0 M05; NO12 M30;

Drill second hole. Retract drill from hole. Rapid move to third hole location. Drill third hole. Retract drill from hole. Rapid move to target point

Fig. Sample part aligned relative to (a) x- and y-axes, and (b) z-axis. Coordinates are given for significant features in (a).

EXAMPLE -Two-Axis Milling


The part is fixtured so that its top surface is 40mm above the surface of the machine tool table. Thus, the origin will be 40 mm above the table surface. Cutter diameter data has been manually entered into offset register 0.5. At the beginning, the cutter will be positioned at a target point located at x = 0, y = -50, and z = +10. NC Part Programme Code Comment N00I G2l G90 G92 X0 Y-050.0 Z0l0.0; Define origin of axes. N002 G00 Z-025.0 Sl000 M03; Rapid to cutter depth, turn spindle N003 G01 G94 G42 Y0 D0S F40; Engage part, start cutter offset. N004 G0I Xl60.0; Mill lower part edge. N005 G0I Y060.0; Mill right straight edge. N006 G 17 G03 X130.0 Y090.0 R030.0; Circular interpolation around arc. N007 G0I X035.0; Mill upper part edge. N008 G0I X0 Y0; Mill left part edge. N009 G40 G00 X-040.0 M05; Rapid exit from part, cancel offset. N0l0G00 X0 Y-050.0; Rapid move to target point. N0ll M30; End of program, stop machine.

3.2.2 Computer-Assisted Part Programming


Manual part programming can be time consuming, tedious, and subject to errors for parts possessing complex geometries or requiring many machining operations. Computer-assisted part programming uses English-like statements that are subsequently translated by the computer into the low level machine code. Tasks are divided between the human and the computer.

The two main tasks of the programmer are: (1) defining the geometry of the workpart and (2) specifying the tool path and operation sequence. Part Prog with Automatically Programmed Tooling (APT) To program in APT, the part geometry is defined; then tool is directed. Thus, there are four types of statements in the APT language: 1. Geometry statements, also called definition statements, define the part geometry elements. 2. Motion commands are used to specify the tool path. 3. Post-processor statements control operation, such as speed and feeds, tolerance and actuate other capabilities of the machine tool. 4. Auxiliary statements, used to name the part program insert comments in the program and accomplish similar functions. These statements are constructed of APT vocabulary words, symbols, and numbers, all arranged using appropriate punctuation. APT vocabulary words consist of six or fewer characters. The characters are alphabet with a very few numerical digits. APT vocabulary contains major words and minor words.

Defining the Part Geometr: work piece is composed of basic geometric elements and mathematically defined surfaces. Nearly any component that can be conceived by a designer can be described by points, straight lines, planes, circles, cylinders, and others. the task is to identify and enumerate the geometric elements of the part in terms of its dimensions and locations relative to other elements. The general form of an APT geometry statement is:

SYMBOL = GEOMETRYTYPE/descriptive data example; P1 = POINT /20.0,40.0,60.0 The statement consists of three sections: 1. 2.
3.

The symbol used to identify the geometry element. The APT major word that identifies the type of geometry element. The descriptive data that define the element precisely, completely and uniquely (dimensional and position).

Points. easily done by designating its x-, y, and z-coordinates and intersection: P1 = POINT /20.0,40.0,60.0 P2 = POINT/INTOF, L1, L2 Lines. A line defined in APT is considered to be of infinite length in both directions. Also, APT treats a line as a vertical plane that is perpendicular to the x-y plane. L3 = LINE/P3, P4 L4 = LINE/P5, PARLEL, L3 Planes. A plane can be defined by specifying three noncollinear points through which the plane passes. It can also be defined as being parallel to previously defined plane. PLI = PLANE/P1, P2, P3, PL2 = PLANE/P2, PARLEL, PL1 Circles. In APT, a circle is considered to be a cylindrical surface that is perpendicular to the x-y plane and extends to infinity in the z-direction. C1 = CIRCLE/CENTER, P1, RADIUS, 25.0 C2 = CIRCLE/P4, P5, P6

Four important APT rules: 1. Coordinate data must be specified in the order x, then y, then z. 2. Any symbols used as descriptive data must have been previously defined; 3. A symbol can be used to define only one geometry element. 4. Only one symbol can be used to define any given element. Specifying tool path and operations sequence. The tool path consists of a sequence of connected line and arc segments, using previously defined geometry elements to guide the cutter. Motion Commands. All APT motion statements follow a common format, The format is: MOTION COMMAND/descriptive data e.g GOTO/P1 What move the tool should make (GOTO) and tell the tool where to go (P1). At the beginning of the sequence of motion statements, the tool must be given a starting point (target point). FROM (initial point) /PTARG; FROM/-20.0, -20.0,0 For point-to-point motions, there are only two commands: GOTO (to a particular point location) and GODLTA (incremental move). GOTO/P2, GOTO/25.0, 40.0, 0

Contouring motion commands are more complicated than PTP commands. The tool is controlled by three surfaces: Drive surface guides the side of the cutter. Part surface bottom nose of the tool is guided on. Check surface stops the forward motion of the tool. Actual or previously defined surface may be selected
There are four APT modifier words in the descriptive data (TO, ON, PAST, and TANTO)

There are four APT modifier words in the descriptive data (TO, ON, PAST, and TANTO)

After the tool reaches the check surface the next move involve a right or left turn or other. There are six motion words, GOLFT - left turn relative to the last move. GORGT - a right turn relative to the last move. GOFWD - move forward relative to the last move. GOBACK - reverse direction relative to the last move. GOUP - move upward relative to the last move. GODOWN - move down relative to the last move.

1. 2. 3. 4.

5.
6.

Example FROM/PTARG GO/TO, PL1, TO, PL2, TO PL3 GORGT/PL3, PAST, PL4 GO/TO, L1, TO, PL2, TO L3 GORGT/L3, PAST, L4 Postprocessor and Auxiliary Statements. control the operation of the machine tool and play a supporting role in generating the tool path. Such statements are used to define cutter size, specify speeds and feeds, turn coolant flow on and off, and control other features of the particular machine tool. POSTPROCESSOR COMMAND/descriptive data examples : UNITS/MM or INCHES; INTOL/0.02 ; OUTTOL/0.02 ; CTTER/20.0 ; SPINDL/1000, CLW ; FEDRAT/40, RPM; RAPID; COOLNT, FLOOD; LOADTL/DI; DELAY/3D

Auxiliary statements are used to identify the part program, specify processor, insert remarks and so on. PARTNO SAMPLE PART NUMBER ONE MACHIN/ specify the post-processor, which specifies the machine tool. CLPRNT; "cutter location prints," REMARK to insert explanatory comments. FINI indicates the end of an APT program.

Computer Tasks in Computer-Assisted Part Programming: consists of: input translation, arithmetic and cutter offset computations, editing, and post-processing. The input translation module converts the coded instructions into computer-usable form, preparatory to further processing: Syntax check Assigning a sequence number to each APT statement in the program; Converting geometry elements into a suitable form for computer processing; and Generating an intermediate file called PROFIL that is utilized in subsequent arithmetic calculations.

The arithmetic module consists of a set of subroutines to perform the mathematical computations required to define the part surface and generate the tool path. The computations are performed on the PROFIL file. The output of this module is CLFILE "cutter location file.", tool path data. In editing, the CLFILE is edited, and a CLDATA is generated which provides readable data on cutter locations and machine tool operating commands. Another APT instruction processed is TRACUT, "transform cutter locations" Which allows a tool path sequence to be transformed from one coordinate system to another. The output is a part program that can be post-processed for the given machine tool. In post-processing, cutter location data and machining commands in the CLDATA file are converted into lowlevel code that can be interpreted by the NC controller. The output is a part program consisting of G-codes, x-, y-, and z- coordinates, S, F, M, and others in word address format.

3.2.3 NC Part Programming Using CAD/CAM


Advanced CAD/CAM systems automate portions of defining the part geometry and specifying tool path. Geometry Definition Using CAD/CAM. If a CAD/CAM system is used, a computer graphics model is developed and stored in database which contains geometric, dimensional, and material specifications for the part. When the same CAD/CAM system, that has access to the same CAD data base in which the part model resides is used part geometry model is retrieved, and use that model to construct the appropriate cutter path. The advantage is that it eliminates the time-consuming steps of geometry definition. After retrieving the model, the procedure is to label the geometric elements that will be used during part programming - variable names (symbols) given to the lines, circles, and surfaces that comprise the part. Most systems have automatic labeling capacity and display the labels on the monitor so that it can then be referred to those labeled elements during tool path construction.

Tool Path Generation Using CAD/CAM. The first step is to select the cutting tool from tool libraries. The programmer decides on appropriate tool for the operation and specify it for the tool path. This permits tool offset calculations. The basic approach in generating the tool path involves the use of the interactive graphics system to enter the motion commands one-by-one, similar to computer-assisted part programming. Individual statements in APT are entered, and the CAD/CAM system provides an immediate graphic display of the action resulting from the command, thereby validating the statement. When the complete part program has been prepared, the CAD/CAM system can provide animated simulation of the program for validation purposes. A more advanced approach is to use automatic software modules available on the CAD/CAM system. These modules are subroutines in the NC programming packages that can be called and the required parameters given to execute the machining cycle.

Common NC Modules for Automatic Programming are: Profile milling Pocket milling Lettering (engraving, mill) Contour turningFacing (turning) Threading (Turning)

Manual Data Input/ conversational programming


Manual and computer-assisted part programming require a relatively high degree of formal documentation and procedure. CAD/CAM part programming automates a substantial portion of the procedure, but a significant commitment in equipment, software, and training is required. A potential method of simplifying the procedure is to have the machine operator perform the part programming task at the machine tool. This is called manual data input (MDI). MDI is perceived as away for the small machine shop to introduce NC without a need to acquire special NC part programming equipment and to hire a part programmer. MDI permits to make a minimal initial investment to begin the transition to modern CNC technology.

Communication between the machine operatorprogrammer and the MDI system is accomplished using a display monitor and alphanumeric keyboard. Entering the programming commands into the controller is typically done using a menu-driven procedure in which the operator responds to prompts and questions posed by the NC system. A computer graphics capability such as tool path and animation of the tool path sequence is included to visualize the machining operations and verify the program. The skills needed are reading engineering drawing be familiar with the machining process. Efficient use of the system requires that programming for the next part be accomplished while the current part is being machined. Most MDI systems permit these two functions to be performed simultaneously to reduce changeover time between jobs.

You might also like