You are on page 1of 49

COMPUTER NUMERICAL CONTROL (CNC)

INTRODUCTION

Definition
Computer Numerical Control (CNC) is one in which the functions and motions of a machine tool are controlled by means of a prepared program containing coded alphanumeric data. CNC can control the motions of the work piece or tool, the input parameters such as feed, depth of cut, speed and the functions such as turning spindle on/off, turning coolant on/off.

Applications
The applications of CNC include both for machine tool as well as nonmachine tool areas. In the machine tool category, CNC is widely used for lathe, drill press, milling machine, grinding unit, laser, sheet-metal press working machine, tube bending machine etc. Highly automated machine tools such as turning center and machining center which change the cutting tools automatically under CNC control have been developed. In the nonmachine tool category, CNC applications include welding machines (are and resistance), coordinate measuring machine, electronic assembly, tape laying and filament winding machines for composites etc.

Advantages and Limitations


The benefits of CNC are 1. High accuracy in manufacturing, 2. Short production time, 3. Greater manufacturing flexibility, 4. Simpler fixturing, 5. Contour machining (2 to 5 - axis machining), 6. Reduced human error. The drawbacks include high cost, maintenance and the requirement of skilled part programmer.

46

ELEMENTS OF A CNC
A CNC system consists of three basic components 1. Part program 2. Machine Control Unit (MCU) 3. Machine tool (lathe, drill press, milling machine etc) Part Program The part program is a detailed set of commands to be followed by the machine tool. Each command specifies a position in the Cartesian coordinate system (x, y, and z) or motion (work piece travel or cutting tool travel), machining parameters and on/off function. Part programmers should be well versed with machine tools, machining processes, effects of process variables and limitations of CNC controls. The part program is written manually or by using computer-assisted language such as APT (Automated Programming Tool).

A typical numerical control system for a milling machine Machine Control Unit The machine control unit (MCU) is a microcomputer that stores the program and executes the commands into actions by the machine tool. The MCU consists of two main units: the data processing unit (DPU) and the control loops unit (CLU). The DPU software includes control system software, calculation algorithms, translation software that converts the part program into a usable format for the MCU, interpolation algorithm to achieve smooth motion of the cutter, editing of part program (in case of errors and changes). The DPU processes the data from the part program and provides it to the CLU which operates the drives attached to the machine lead screws and receives feedback signals on the actual position and velocity of each one of the axis. A driver (dc motor) and a feedback device are attached to the lead
46

screw. The CLU consists of the circuits for position and velocity control loops, deceleration and backlash take up, function controls such as spindle on/off.

Machine Tool
The machine tool could be one of the following: lathe, milling machine, laser, plasma, coordinate measuring machine etc. That a right-hand coordinate system is used to describe the motions of a machine tool. There are three linear axes (x, y, z), three rotational axes (I, j, k) and other axes such as tilt. (O) are possible. For example, a 5-axis machine implies any combination of x, y, z, I, j, k and O.

Right-hand coordinate system used in drill press and lathe.

46

PRINCIPLES OF CNC Basic Length Unit (BLU) Each BLU unit corresponds to the position resolution of the axis of motion. For example, 1 BLU = 0.0001 means that the axis will move 0.0001 for every one electrical pulse received by the motor. The BLU is also referred to as Bit (binary digit) Pulse = BLU = Bit Point-to-Point System Point-to-point systems are those that move the tool or the work piece from one point to another and then the tool performs the required task. Upon completion, the tool (or work piece) moves to the next position and the cycle is repeated. The simplest example for this type of system is a drilling machine where the work piece moves. In this system, the feed rate and the path of the cutting tool (or work piece) have no significance on the machining process. The accuracy of positioning depends on the systems resolution in terms of BLU (basic length unit) which is generally between 0.001 and 0.0001. Y

Next Point Starting Point X

Cutter path between holes in a point-to-point system

46

Continuous Path Systems (Straight cut and contouring systems) These systems provide continuous path such that the tool can perform while the axis are moving, enabling the system to generate angular surfaces, twodimensional curves, or three-dimensional contours. Example is a milling machine where such tasks are accomplished. Each axis might move continuously at a different velocity. Velocity error is significant in affecting the positions of the cutter. It is more important in circular contour cutting where one axis follows sine function while the other follows cosine function. Figure 6 illustrates point-to-point and continuous path for various machines. Cutter Radius Cutter Y Currect path Error b a Cutter Path path Machined Surface X (a) Continuous path cutting and velocity error (b) Position error caused by the Incorrect

46

Incremental and Absolute systems


CNC systems are further divided into incremental and absolute systems. In incremental mode, the distance is measured from one point to the next. For example, if you want to drill five holes at different locations, the x-position commands are x + 500, + 200, + -600, -300, -700, -300. As absolute system is one in which all the moving commands are referred from a reference point (zero point or origin). For the above case, the x-position referred from a reference point 9zero point or origin). For the above case, the x-position commands are x 500,700, 1300, 1000, 300, 0. Both systems are incorporated in most CNC systems. For an inexperienced operator, it is wise to use incremental mode.

(a). Absolute versus incremental; In absolute positioning, the move is specified by X = 6, y = 8; in incremental, the move is specified by x=4, y=5 for the tool to be moved from (2,3) to (6,8) (b). Drilling 5-holes at different locations. The absolute system has two significant advantages over the incremental system. 1 Interruptions caused by, for example, tool breakage (or tool change, or checking the parts), would not affect the position at the interruption.
46

If a tool is to be replaced at some stage, the operator manually moves the table, exchanges the tool, and has to return the table to the beginning of the segment in which the interruption has occurred. In the absolute mode, the tool is automatically returned to the position. In incremental mode, it is almost impossible to bring it precisely to that location unless you repeat the part program. 2 Easy change of dimensional data

The incremental mode has two advantages over the absolute mode. 1. Inspection of the program is easier because the sum of position commands for each axis must be zero. A nonzero sum indicated an error. Such an inspection is impossible with the absolute system. 2. Mirror image programming (for example, symmetrical-geometry of the parts) is simple by changing the signs of the position commands. Open Loop Control System The open-loop control means that there is no feedback and uses stepping motors for driving the lead screw. A stepping motor is a device whose output shaft rotates through a fixed angle in response to an input pulse. The accuracy of the system depends on the motors ability to step through the exact number. The frequency of the stepping motor depends on the load torque. The higher the load torque, lower would be the frequency. Excessive load torque my occur in motors due to the cutting forces in machine tools. Hence, this system is more suitable for cases where the tool force does not exist (Example: laser cutting). The stepping motor is driven by a series of electrical pulses generated by the MCU. Each pulse causes the motor to rotate a fraction of one revolution. The fraction is expressed in terms of the step angle, a, given by a = 360/N, degrees where N = number of pulses required for one revolution If the motor receives n number of pulses then the total angle, A = n (360/N), degrees In terms of the number of revolutions, it would be (n/N) If there is a 1:1 gear ratio between the motor and the lead screw, then the lead screw has (n/N) revolutions. If the pitch of lead screw is p (in/rev), then the distance travelled axially, say x, X = p(n/N) can be used to achieve a specified x-increment in a point-to-point system. The pulse frequency, f, in pulses/sec determines the travel speed of the tool or the work piece. 60 f = N (RPM) where N = number of pulses per revolution. RPM = RPM of the lead screw.
46

The travel speed, V, is then given by V = p (RPM) where p pitch in/rev Example 1 A stepping motor has N = 150, p = 0.2/rev; If n = 2250 pulses, what is the distance travelled in x-direction? What should be the pulse frequency for a travel speed of 16 in./min? X = (0.2) (2250)/150 = 3 16 = 0.2 (rpm), from which, RPM = 80 f = (150) (80)/60 = 200 Hz

Closed-loop Control System Closed-loop NC systems are appropriate when there is a force resisting the movement of the tool/work piece. Milling and turning are typical examples. In these systems (Figure 10) the DC servomotors and feedback devices are used to ensure that the desired position is achieved. The feedback sensor used is an optical encoder shown in Figure 11. The encoder consists of a light source, a photo detector, and a disk containing a series of slots. The encoder is connected to the lead screw. As the screw turns, the slots cause the light to be seen by the photo detector as a series of flashes which are converted into an equivalent series of electrical pulses which are then used to characterize the position and the speed. The equations remain essentially the same as open-loop except that the angle between the slots in the disk is the step angle, a. Both the input to the control loop and the feedback signals are a sequence of pulses, each pulse representing a BLU unit. The two sequences are correlated by a comparator and gives a signal, by means of a digital-toanalog converter, (a signal representing the position error), to operate the drive motor (DC servomotor). Example 3 Consider a CNC worktable driven by a closed-loop control system consisting of a servomotor, lead screw, and optical encoder. The lead screw has a pitch, p = 0.2 and is coupled to the motor shaft with a screw to motor gear ration of 1:4. The encoder generates 150 pulses per revolution of the lead screw. If the number of pulses and the pulse rate received by the control system are 2250 and 200 Hz respectively, calculate a b c Table Speed Motor speed in RPM Distance travelled by the table

a V = p(RPM) = 0.2(RPM) = (0.2) (60 f)/N = (0.2) (60) (200)/150 = 16 in/min b RPM of the lead screw = (60) (200)/(150) = 80 RPM of the motor = 320 c x = p(n/N) = (0.2) (2250)/150 =3
46

Example 4 A de servomotor is coupled to a lead screw which drives the table of a CNC machine tool. A digital encoder, mounted at the end of the screw, emits 500 pulses per revolution. If the pitch is 5 mm per rev, and the motor rotates 600 rpm (1:1 gear ratio), calculate the a b c a b c Table speed BLU Frequency of pulses transmitted by the encoder V = p(RPM) = 5 (600) = 3000 mm/min = 3 m/min BLU = 5/500 = 0.01 mm RPM = 600 = (60f)/N -= 60 f/500 from which f = 5000 Hz

PRECISION IN CNC MACHINING


The combined characteristics of the machine tool and the control determine the precision of positioning. Three critical measures of precision are: Resolution Accuracy Repeatability

Control resolution (BLU) is the distance separating two adjacent points in the axis movement (the smallest change in the position). The electromechanical components of the positioning system that affect the resolution are the lead screw pitch, the gear ratio, and the step angle in the stepping motor (open loop) or the angle between the slots in the encoder (closed-loop). The control resolution for a 1:1 gear ratio of a stepped motor is, Resolution = p/N where p = pitch and N = 360/a. Features smaller than the control resolution could not be produced. The programming resolution cannot exceed the control resolution. Accuracy of a CNC system depends on the resolution, the computer control algorithms and the machine inaccuracies. The inaccuracy due to the resolution is considered to be (1/2) BLU on the average. The control algorithm inaccuracy is due to the rounding off the errors in the computer which is insignificant. The machine inaccuracy could be due to several reasons (described below). The designer minimizes this inaccuracy to be under (1/2)BLU and hence Accuracy = (1/2) Resolution + Machining inaccuracy = BLU
46

Repeatability is a statistical term associated with accuracy. It refers to the capability of a positioning system to return to a programmed point and is measured in terms of the errors associated with the programmed point. The deviation from the control point (error) usually follows a normal distribution in which case the repeatability may be given as +/- 3o where o is the standard deviation. The repeatability is always better than the accuracy. The mechanical inaccuracy can be considered as the repeatability. Figure 12 shows the difference between the accuracy and the repeatability, Machining Inaccuracy Cutting tool deflection, machine tool chatter, mechanical linkage between the lead screw and the tool and thermal deformations are the chief contributing factors. The lead screw transmits the power to the table or tool holder by means of a nut that engages the lead screw. This will create what is known as backlash due to the friction between the screw and the nut. If the nut consists of ball bearings, the friction is reduced. Thermal deformations are significant. For example, a temperature difference of 1 degree C along 1000 mm can cause an error of 0.01 mm.

PART PROGRAMMING
Program is encoded information giving co-ordinate values and other details which indicate how the tool should be moved in relation to a work piece in order to achieve a desired machining form. Program contains all the information for the machining of a component which is input to the control unit. The control unit provides control signal at the correct time and in correct sequence to the various drive units of the machine. The data given in a program block may be divided into two parts namely:1. Control Data 2. Dimensional Data Control Data include preparatory functions and miscellaneous functions which command the v functions like axes movement, tool change, etc. Dimensional data include the co-ordinate values of X, Y and Z axes. AXIS AND MOTION NOMENCLATURE Right hand Cartesian co-ordinate system is used as a standard and it is always assumed that the cutting tool moves relative to the work piece: Z+ Y+

46

XYZ-

X+

X-Axis:- The X axis is always horizontal and is parallel to the work holding surface. Positive X-axis is to the right when looking from the spindle towards the work piece. Z-Axis:- Z-Axis is the main machine spindle axis. The Z axis is positive in a direction away from work piece towards the spindle. Y-Axis:- The Y axis is perpendicular to both X and Z axis. The positive direction of Y axis is away from the spindle looking from spindle towards the work piece.

A, B & C are the rotary axes of motion around X, Y and Z axes respectively. Positive A, B and C in the direction which advances a right handed screw in the positive X, Y and Z axes respectively. STRUCTURE OF A PART PROGRAM A part program defines a sequence of machining operations. The information contained in the program can be dimensional or non-dimensional like speed, feed, auxiliary functions etc. The basic unit of part program input to the control is called a block. Each block contains adequate information for the machine to perform a movement or other functions. A block in turn is made
46

up words and a word has a number of characters. All blocks are terminated by block end character A block may contain any or all of the following N0000 G00 X000.000 Y000.000 M00 S0000 T00 H00 F; (end of Optional block slip) BLOCK or SEQUENCE NUMBER A block may have sequence number at its head. Sequence numbers are mainly used for the convenience of the operators in identifying the different operations. Block numbers are need not be consecutive and it is not a must to have a block number.

PREPARATORY FUNCTION These are codes which prepare the machine to perform a particular function like positioning, contouring, canned cycles etc. The following are the important G codes which are used in general.

G code
G00 G01 G02 G03 G04 G17 G18 G19 G20 G21 G27 G28 G29 G30 G40 G41 G42 G43

Function
Positioning Linear interpolation Circular Interpolation CW Circular Interpolation CCW Dwell XY Plane selection XY Plane selection YZ Plane selection Input in inch Input in mm Reference point return check Reference point return Return from reference position 2nd, 3rd reference position return Cutter Compensation cancel Cutter radius compensation (Left0 Cutter compensation (Right) Tool length compensation (+v direction)
46

G44 G49 G52 G53 G54 to G59 G61 G63 G64 G68 G69 G70 G71 G80 G81 G82 G83 G84 G85 G87 G90 G91 G92 G94 G95 G98 G99 Model G code

Tool length compensation (-ve direction) Tool length compensation (cancel0 Local co-ordinate system setting Machine co-ordinate system setting Work piece co-ordinate system selection Exact stop mode Tapping mode Cutting mode Co-ordinate rotation Co-ordinate rotation cancel Inch mode Metric mode Canned cycle cancel Drilling cycle Counter Boring cycle Peck drilling cycle Tapping cycle Boring cycle Back boring cycle Absolute command Incremental command Setting of work co-ordinate system Feed/min Feed/rev Return to initial point in canned cycle Return to R point in canned cycle

N100 G91 X -5.0 Y7.0 F100 S200 TO1 M03 (EOB) The significance of each term is explained below Sequence Number, N Consisting of typically three digits, its purpose is to identify the specific machining operation through the block number particularly when testing a part program. Preparatory Function, G It prepares the MCU circuits to perform a specific operation. The G-codes (some) are shown in Table G91 implies incremental mode of operation. Dimension Words 1 Distance dimension words, X, Y, Z 2 Circular dimension words, I, J, K for distance to the arc center
46

Angular dimensions, A, B, C

While (1) and (3) are expressed either by incremental or absolute mode, (2) is always is given in incremental mode. All angular dimensions are specified in revolutions or degrees. In the above block, X moves a distance of 3 in. in the negative direction while Y moves a distance of 7 in. in the positive direction. Other axes remain stationary. In some systems, actual distances are used. In others, the dimension words are programmed in BLUs. Feedrate, F It is expressed in in/min and is used in contouring or point-to-point or straight-cut systems. For example, a federate of F100 implies 100 in/min or 100 mm/min. Federates are independent of spindle speed. In linear motions, the federate of the cutting tool is not corrected for the cutter radius. But in circular motions, the federate should be corrected for the tool radius as follows: F= [(part contour radius + tool radius)/part contour radius] (required federate) For cutting around the outside of a circle, the plus sign in the above equation is used and the federate is increased. For cutting around the inside of a circle, the minus sign is used and the federate is decreased. Spindle speed, S Programmed in rev/min, it is expressed as RPM or by a three-digit code number that is related to the RPM. Tool word, T Consisting of a maximum of five digits, each cutting tool has a different code number. The tool is automatically selected by the automatic tool changer when the code number is programmed in a block. Miscellaneous Function, M Consisting of two digits, this word relates to the movement of the machine in terms of spindle on/off, coolant on/off etc. shown in Table 2. EOB The EOB character is used at the end of each block to complete a line. DIMENSIONING Co-ordinates specifying the destination dimensions are programmed in two ways namely; a) Absolute dimension programming b) Incremental dimension programming Absolute Dimension Programming: In this system all dimensions are taken from a single point, called origin or work zero. In the Fig. shown all the dimensions are considered from the
46

point O which is work zero. Absolute dimensions are programmed using the code G90. Command format: G90 X. Y. Z ;

Incremental Dimension Programming: In this system, the distance from previous tool position to the destination is given. Incremental programming is done using G91 command. G91: X Y.. Z; The fig. clearly shows, explains the difference between absolute and incremental dimensioning.

MISCELLANEOUS FUNCTIONS (M-CODES) These are the operations associated with the machine for functions other than positioning or contouring, like, coolant off and on, Spindle rotation etc. The following are the standard M-codes M00 Program stop (conditional) M01 Program stop (conditional) M02 End of program with return to program start
46

M03 M04 M05 M06 M07 M09 M19 M20 M28 M29 M30 M45 M98 M99 Optional M12 M13 M14 M15 M22 M23 M24 M25 M31 M46 M47 M48 M49 M52 M53 M54 M55 M80 M81 M82 M83 M89 M90 M91 M92 M93 M94 M97

Spindle rotation CW Spindle rotation CCW Spindle stop Tool change Coolant ON Coolant OFF Spindle orientation Spindle orientation release Rigid tap OFF Rigid tap ON End of program Tool unclamp, enable in MDI, HANDLE Mode (MCV-400) Sub program call Sub program end.

Component clamp Component de-clamp Rotary table clamp Rotary table de-clamp Pallet-1 load Pallet-1 unload Pallet-2 load Pallet-2 unload Probe ON/OFF Auto door close Auto door open Flush coolant ON Flush coolant OFF High pr. Coolant -1(25 bar) ON High pr. Coolant -1(25 bar) OFF High pr. Coolant -2(65 bar) ON High pr. Coolant -2(65 bar) OFF Auto pallet change Enable pallet 1 transfer in auto mode Enable pallet 2 transfer in auto mode Enable both pallet transfer in auto mode Pallet 1 Sub program Pallet 2 Sub program Tool monitoring auto interface enable Tool monitoring Auto interface disable Tool monitoring AC enable during AID Tool monitoring AC disable during AID Part count

Procedure for taking work offsets


46

1. Perform reference return 2. Put a tool of known radius or a mandrel of known radius to the spindle 3. Move the axes in jog (or) Handle mode in such a way that periphery of tool or mandrel coincides with face (A)of job 4. Now note down the machine value in X axis, say X 5. X offset is given by x-R 6. Similarly coincide the periphery of tool or mandrel with face B 7. Note down the machine value in Y axis say y 8. Y offset is given by y-R i.e Y-(M/c value mandrel radius) 9. For taking Z offset touch the tool tip of the surface 10. And note down the value in Z axis, say z Now Z offset =Z+ tool length L (or) Z only The offset values of X,Y and Z can be entered in any of G54 to G59

VERTICAL MODE

HORIZONTAL MODE

46

Programming methods comparison


Absolute system the path information given is always calculated from a definite starting point slides Y Incremental system the zero reference point for each path information is the current position of the

A(0,3) b c

B(2,3)

d c(2,2)

D(3.5,2) e E(4.5,0.5)

0 (0,0)

Path a b

X 2

Y 3

Path a b

X 2

Y 3

46

c d e 3.5 4.5

2 0.5

c d e 1.5 1

-1 -1.5 Point O,A,B,C,D are

Point O is the reference point new reference points

Absolute system system If you have to change the position of a point, change the All other points still again unchanged

Incremental If you have to

position of one point, all the following ones will have to be changed as well.

Y b A(0,3) b

B(2,4)

B(2,3) c d D(3.5,2) e E(4.5,0.5)

c(2,2)

0 (0,0) old path A-B-C-D-E

46

new path A-B-C-D-E Path a b c d 3.5 X 2 Y 3 4 2 Path a b c d e 1.5 1 -1.5 Since Point B was changed the description for B and C, also X 2 Y 3 1 -2

e 4.5 0.5 Point B has to be changed to point B. The description change B only changes

Program codes : The block number This code is used to sequence and identify a block of data in a part program. Selectable numbers are NO to N000. Preparatory commands G codes are used to initiate control commands, [positioning] or contouring modes of operation and machining cycles. There are two types of G codes modal and non-modal. Modal codes remain active until cancelled by a contradictory code. Non-modal G codes are active only in the block in which they are programmed. The list of G codes is given in table 5.2 X Y Z : : : Command for X axis movement Command for x axis movement Command for Z axis movement. The dimension of these words specifies the direction and the distance which is to be traversed. The dimension is interpreted

46

as either absolute or incremental, millimeters or inches, as determined by the G codes active in that block. X value can range between 0 and +/-200mm (7.874 in) Y value can range between 0 and +/-125mm (4.921in) Z value can range between 0 and +/-125mm (4.921 in) The format for these words is a). b) +/-3.2 in mm mode +/-2.3 in inch mode

Multiple values for the same axis in a block are not accepted. Under G4 the format for X word is 2 M : Miscellaneous functions Miscellaneous T : functions contain primarily technological specifications. The format should be 2 Tool Offset number The corresponding offsets (in X and Z direction, as programmed in Tool offset page) become active. In this machine 10 pairs of tool offsets can be programmed. D L : : Selection of Tool nose radius compensation number. Sub routine call. Calls a sub routine programmed under this name. A sub routine can have number ranging from L0 to L000 P R : : Sub routine repetition number Maximum 00 repetitions are possible. R parameter R parameters ranging from R1 to R00 in conjunction with arithmetic parameters +, -, x, / provide for parametric programming facility. Explanation of G Codes G00 Rapid Traverse The Code specifies a linear movement at the rapid feed rate. G00 is a modal code, it remains active until cancelled by G01, G02, and G03. The position of the slides when the job is not
46

being cut must be done with highest possible speed for economic reasons. Both X and Z can be moved individually or simultaneously. The feed rate need not be programmed. value stored in the system is 700mm/min. Z Example 1 40 20 X P1 20 Z20 Tool moves from P1 To P2 60 X P2 Absolute Mode: G00, G90 X 60 Z40 Incremental Mode: G00 G91 X 40 The rapid feed rate

G01 Linear Interpolation This code is used for straight line action of tool both in X and Z separately or simultaneously at the programmed feed rate. The programmed feed rate is the velocity in both X and Z directions. G01 is a modal code. G00,G02,G03. Example: For the above Exampled the GO1 block would be: G1 G90 X 60 Z40 F400 OR G1 G91 X 40 Z20 F400 The tool moves from P1 to P2 with feed rate 400mm/min with absolute coordinates in the first case and incremental coordinates in the second case. G02 Circular Interpolation Clockwise:
46

It remains active and is cancelled by

G03 Circular Interpolation Counter Clockwise ISO describes Circular Interpolation G02 (G03) as follows: Circulation Interpolation in which the curvature of the path of the tool with respect to the work piece is clockwise (counter clockwise) when the plane of the motion is viewed in the negative direction of the axis perpendicular to it. The starting point of the circle or arc is determined by the previous block. The end point is fixed by the respective axes values programmed in the block. The circle centre is determined by I, J and K vectors, which specify the incremental (signed) distance of the circle center point from the circle starting point. I is the incremental (signed) distance parallel to the X axis and J is the incremental (signed) distance parallel to Y axis and K is the incremental (signed) distance parallel to Z axis. These will remain unchanged irrespective of whether (G91) mode, G02 and G03 are effective until cancelled by G00, G01. Circular Interpolation of any two axis at a time is possible. Example

Y 1(20,30) r12 P(32,30) 2(32,27)


46

r12 (32,15) O(o,o) To machine the profile starting from point 1 to 3 M1 M2 M3 M4 M5 M6 G90 G17 G00 X 20 Y30 G03 X 32 Y27 I12 J0 F400 (Point 1 to 2) G02 X 44 Y15 I0 J-12 M30 (Point 2 to 3) 3(44,15) X

To machine the profile starting from point 3 to 1 N1 N2 N3 N4 N5 N6 G90 G17 600 C 44 Y15 G03 X 32 Y27 I-12 JO F400 (Point 3 to 2) G02 X 20 Y30 I0 J12 M30 Dwell is (Point 2 to 1)

G04 Dwell The dwell time is programmed under the address X. programmed on an unsigned number. Dwell duration lies between 1 second & 99 seconds. The dwell time is effective only in the block in which it is programmed. Dwell is not accepted in MDI mode Example Dwell time of 10 seconds is programmed as N1 G04 X 10 G17 Machining plane selection G18 By programming G17. G18, G19, the plane is defined in

46

G19 which cutter radius compensation is available. If a plane has not been selected at the start of the program, the default plane will be defined by G17.

G17 X-Y plane selection When movement of X and Y is intended G17 code has to be programmed. It is a modal code and will be effective until cancelled by G18 or G19.

Example: N1 N2 N3 N5 N6 G17 G01 X 10 Y-50 F100 X5 25 M30

G18 X-Z plane selection When movement of X and Z is intended G18 code has to be programmed. It is a modal code and will be effective until cancelled by G17 or G19.
46

Example N1 N2 N3 N4 N5 N6 G18 G01 X 10 Z-50 F100 X5 Y5 Z5 M30

G19 X-Z plane selection When movement of Y and Z is intended G19 code has to be programmed. It is a modal code and will be effective until cancelled by G17 or G18. Example N1 N2 N3 N4 N5 N6 G19 G01 Y10 Z-50 F100 X5 Y5 Z5 M30

Note: Single axis movement of any axis in any plane is allowed.

G40 Cancellation of cutter radius compensation G41 Cutter radius compensation to the left of the programmed path. G42 Cutter radius compensation to the right of the programmed path.

46

When CRC is selected, the control reads in two further blocks in advance during processing of the current block and calculates the intersection point of the compensated paths. The compensation mode is selected with G41/G42 and offset number D. The D value has to be programmed in the same block as G41/G42.

The compensated mode is selected in a program block with G00 or G01 or in the block previous to a linear interpolation (G00/G01) block. Circular interpolation is not permitted as the first movement block on selection of CRC (G41/G42). Offset number D0 is assigned the compensation value 0. Note: The cutter radius compensation is active in the selected plane. Negative CRC values are not allowed.
46

While using G41/G42 following guidelines should be carefully followed. G17 must be programmed as CRC is active in XY plane only. The radius compensation value has to be programmed under X code in the tool offset data page. Corresponding D value has to be programmed in the program either in the same block where G41 or G4 is programmed or earlier to it. Different plane selection (G18 or G19) or position present (G92) are not allowed after G41 or G42 is active. G90 or G91 and G70 or G71 should be programmed before G41 or G42 is active. G41 or G42 activation should not follow a circular interpolation block. A linear interpolation block has to be programmed along the diameter of the circle. If the tool path motion is linear, the entry and exit has to be perpendicular with respect to next block or previous block respectively.

N01 G17
46

N02 G0 X 20 Y10 N03 Z10 N04 G42 D1 N05 G1 Y20 F100 N06 X 30 N07 X 60 Y30 N08 Y50 N09 X 20 N10 Y20 N11 G40 N12 X 10 N13 M30 Entry block

(a) The motion in the block NO7 after G42 code (entry block) is perpendicular to the motion programmed in the N08 block. (b)The motion in the block N13 after G40 code (exit block) is perpendicular to the motion programmed in the N12 block before G40 was programmed. The entry and exit should be along the diameter of an arc if the CRC is indicated along a circle.

46

N00 G90 N01 G92 X 0 Y0 Z0 N02 G17 N03 G0 X 10 Y20 N04 G18 M3 S2000 N05 Z-10 N06 G17 N07 G01 F200 N08 G41 D1 N09 X 30 N10 G02 X 50 Y20 I25 J0 F200 N11 G40 N12 G01 X 100 N13 G01 Z0 N14 G0 X 0 Y0 N15 M30 (a) The first linear motion block NO8 after G41 code (entry block) is along the diameter as N09 block contains circular interpolation. (b)The linear motion block Nil after G40 code (exit block) is along the diameter as previous block N09 contains circular interpolation.

46

In view of the limited traverses of the slides, it is advised not to program a tool path with line to line intersectional angle less than 45 degrees.

should not be less than 45 degrees.

If the tool path is along a line and circle or vice-versa, angle between the line segment and tangent to the circle at the intersection point should be greater than 60 degrees.

than 2 1 4 3

should

be

greater

60 degrees

If the inside profiles contain a line segment and a circle segment cutter radius compensation value should be less than the radius of the circle segment.
46

The CRC value should not be equal to the radius of any arc programmed in the path while machining an outside profile.

CRC value larger than the smallest linear program motion or larger than the smallest radius of the circle programmed is not allowed.

Example Using (G41)

46

N00 G90 N01 G17 N02 G0 X 0 Y0 N03 G18 M03 S1000 N04 Z -10 N05 G41 D1 N06 G1 X 20 F100 N07 Y50 N08 X 30 N09 X 40 Y 40 N10 X 50 N11 Y36 N12 G03 X 50 Y25 I6 J-5 N13 G01 Y20 N14 X 00 N15 G40 N16 X 0 Y0 N17 M30 Example Using G42
46

Entry block

(20,50)

(50,40) COMPENSATED (40,40) (50,35) (56,30) (50,25) PATH

G42 PROGRAMMED PATH (20,10) (0,0) N00 G90 N01 G17 N02 G92 X 0 Y0 N03 M03 S1000 N04 G01 Z-10 F300 N05 G17 N06 G42 D1 N07 G1 Y20 F100 N08 X 50 N09 Y25 N10 G02 X 50 Y35 I0 J5 N11 G01 Y40 N12 X 40 N13 X 30 Y50 N14 X 20 N15 Y0 N16 G40 N17 G01 Z0 F300 N18 G0 X 0 Y0 N19 M30 G53 Cancelling the Zero Offsets
46

Entry block

G53

suppresses

block-wise

the

coordinate

displacement

achieved by set table zero point offsets (G54, G55, G56, G57). In blocks following G53 all zero offsets are again active. G54 Zero Offsets G55 The zero point offset is the difference between the work piece zero point (to G56 which the part program dimensions are related) and the machine zero point. The G56 values for zero point offset for each axis can be entered into the system via the ZERO OFFSETS page in SETTING DATA mode. The offset is included while calculating the block ends points, if the associated axis is programmed. G54 is the default code and is always called, unless suppressed byG53 or over-ridden by other zero offset codes. G70 Inch mode This mode is not active at power on of the control system and must be programmed, if required. The use of this code will enable the control to accept part program dimensions in Inches. Once programmed, G70 remains in effect until cancelled by G71. G71 Metric mode As the basic mode of the system is metric, it is not necessary to program G71 except when cancelling G70. This code enables the control to accept part program dimensions in millimeters. The system remains in metric until a G70 is programmed. Note: The following must be programmed prior to a canned cycle call 1. Tool number 2. Spindle on CW/CCW 3. Spindle speed
46

4. Cutter radius 5. Position blocks to start position G80 Canned cycle cancel G81 Drilling cycle In this cycle drilling will be done to a programmed depth from a starting position at programmed feed rate. starting position. After reaching the depth the tool will be withdrawn at rapid feed rate up to the

Programming format: G81 Z F Z = Depth of cut N1 G90 N2 G92 X 0 Y0 Z0 N3 G00 X 10 Y10 N4 M3 S1000 N5 G01 Z-10 F300 N6 G81 Z-30 F100
46

Example:

N7 G80 N8 G01 Z0 F300 N9 G00 X 0 Y0 N10 M30

G82: COUNTER BORING COMMAND FORMAT G82 G90/G91 G98/G99 X_Y_Z_R_P_F_;

This is identical to the G81 cycle except that a dwell time (designated by a P code) is Provided at the hole bottom. Because of the dwell time, the depth of a hole made by counter boring can be have greater accuracy X, Y Z F - drilling point on the X, Y plane - drilling bottom point - drilling feed rate per minute

G98 - return to initial point G99 - return to point R R P - position of R point (distance from z0 plane) - dwell setting Eg P 1000 dwell time of 1 second

46

G83 Peck drilling cycle When the I/D ratio of the hole to be drilled is greater than 10, it is desirable to withdraw the tool at regular intervals to avoid clogging of chips. drilling. From the starting position the tool penetrates the work piece for the first pecking depth at the programmed feed rate. After reaching the first pecking depth the tool is retracted to the starting position in rapid feed and then makes a new plunge taking the advanced stop distance in to account. The tool makes further penetration by the pecking depth and retracts again. Pecking action is repeated until the programmed hole depth is reached. At the end of the cycle the tool returns to the starting point. This type of drilling is called wood peck

Programming format: G83 Z K F Z = depth of cut K = increment depth (pecking depth)


46

Example: N1 G90 N2 G92 X 0 Y0 Z0 N3 G0 X 10 Y10 N4 M3 S1000 N5 G01 Z=10 F300 N6 G81 Z=30 K10 F100 N7 G80 N8 G01 Z0 F300 N9 G00 x 0 y0 N10 M30

G85 Boring cycle The cycle is same as the drilling cycle, the difference is the rotation of the tool will be stopped after the bore is machined and the tool will be withdrawn at rapid rate up to the starting position. Programming format: G85 Z X F, Z = depth of cut X = dwell time. Example: N1 G90 N2 G92 X 0 Y0 Z0 N3 G00 X 10 Y10 N4 M3 S1000 N5 G01 X-10 F300 N6 G85 X1 Z-30 F100 N7 G80 N8 G01 Z0 F300 N9 GOO X0 Y0 N10 M30 Dwell time of 1 sec is prepared.

46

G86 PCD drilling cycle This cycle drills holes positioned at equal angles on the periphery of a pitch circle, the radius of which can be programmed.

Programming formats: Z = Depth of each hole X = Radius

G86 Z X J F

J = Number of drill holes (J must be less than ____) Example N1 G90


46

N2 G92 X 0 Y0 Z0 N3 G00 X 10 Y10 N4 M3 S1000 N5 G01 Z-10 F300 N6 G88 X 10 Z-20 J4 F100 N7 G80 N8 G01 Z0 F300 N9 G00 X 0 Y0 N10 M30 G88 Rectangular pocket milling cycle This cycle machines a rectangular pocket of programmed height, width and length. The tool penetrates at the starting position (centre of the pocket) with pecking depth K at the programmed feed rate. After reaching the first pecking depth the tool follows the path as indicated in the figures. The incremental step over distance is radius of the mill then the tool is retracted to the starting position in rapid feed and then makes a new plunge taking the advance stop distance into account. The tool makes further penetration by the pecking depth and follows the path as indicated in the figure and retracts again. Pecking action is repeated until the programmed depth is reached. At the end of the cycle the tool returns to the starting position. Programming formats: Z E D = Depth (total depth) = Increment depth (pecking depth) = Tool number (for tool radius) G88 Z X Y K D F

X,Y = Rectangle sides

Example: N1 G90 N2 G92 X0 Y0 Z0


46

N3 G00 X 10 Y10 N4 M3 S1000 N5 G01 Z-10 F300 N6 G88 X 10 Y10 Z-19 K3 D1 F100 N7 G80 N8 G01 Z0 F300 N9 G00 X0 Y0 N10 M30

46

G89 Circular pocket milling cycle

46

This cycle machine a circular pocket of programmed radius. The tool penetrates at the starting position (center of the pocket) with pecking depth K. The milling tool then follows the path as indicated. The starting direction of the tool patch is always positive X direction. The incremental step over distance is the radius of the mill. The procedure is repeated until the programmed milling depth is reached. Finally the tool is retracted to the starting position. Programming format: G89 Z X K D F Z = depth X = Radius of the circle K = Increment depth (Pecking depth) D = Tool number (for tool radius). Example: N1 G90 N2 G02 X 0 Y10 N3 G00 X 10 Y10 M4 G01 Z-10 F300 N5 G89 M3 X10 Z-19 K3 F100 S1500 D1 N6 G80 N7 G01 Z0 F300 N8 G00 X0 Y0 N9 M30

46

G90 Absolute mode


46

This code is used to select the absolute mode for X, Y and Z axis dimensions and defines the tool path as the tool distance from a fixed zero position. This mode will remain in effect until changed by programming a G91 code for the incremental mode of operation. Example: If Z axis is already positioned at 50 mm and the next command in the absolute mode is 50mm in the Z direction, no axis motion will occur. G91 Incremental mode If this code is programmed X Y & Z, words are taken to be incremental path departures from the present position. The state of the control will remain in the incremental mode until G90 is programmed. Example: With respect to the previous example, if Z axis is already positioned at 50mm and the next command in incremental mdoe is 50mm in the Z direction, then the tool will move along the Z axis by 50mm. G92 Position preset This code sets the position registers to the values specified by X, Y & Z codes programmed in the same block. Position preset occurs only for the axis programmed and will not cause axis motion. No other G codes are accepted with this rule. Example N1 G02 X1.5 Y2.5 After executing the above block, X position will be preset to 1.5mm and Y position will be present to 2.5mm G94 Feed rate per minute This code is used when the feed rate is to be programmed in mm per minute OR inch per minute. The value programmed in the F word represents the feed rate directly in mm/min or inch/min depending on whether G71 or G70 is active.
46

At power on, G94 will be active. G94 will remain active until G95 is programmed. The format for F word under this is +3.0 in mm/min and +2.1 in inch/min. G95 Feed rate per Revolution This code allows the feed rate to be programmed in mm per revolution OR inch per revolution. The value programmed in the F word represents the feed rate directly in mm/rev or inch/rev depending on whether G71 or G70 is active.This mode is effective until cancelled by G94. The format for F word under this is +1.3 in mm/rev and +0.3 in inch/rev. Miscellaneous Functions M M00 Program Stop MOO enables an executing program to stop. An operation my be performed and when completed, program execution can commence by pressing the CYCLE. START Stored information is not affected. MO is recognized as MOO. M01 Optional Stop An executing program stops at this block if the optional stop flag is ON. On pressing CYCLE START key program execution starts at the next block. Stored information is not affected. M02 End of program M02 is programmed as the last program block. Program execution ends at M02. M2 is recognized as M02. M03 Spindle start clockwise M04 Spindle start counter clockwise

46

M05 Spindle stop M06 Tool change M17 End of Sub-routine M17 is programmed as the last sub-routine block. It signals a sub-routine return to the calling program. M30 Program End M30 is similar to M02. However, no execution of the program is possible by pressing CYCLE START.

Tool Offsets Two geometric values of the tool, its length along Z axis and radius as X value can be stored under a tool offset number in the tool offset page. There are a total of 16 tool offsets (T1 to T10) recognized by this machine. They are arranged in two pages of 8 offsets each. Once called they remain active till cancelled by T00 or suppressed by a different tool offset. Tool offset data is always given in metric. D00: Cancelling Tool Offset Cancels the active tool offset. Sub routines L Repetitive patterns and function cycles can be stored as subroutines which can be called arbitrarily by the part program. A sub routine name begins with L followed by up to 3 digits. They must be entered as any other part program in the PROGRAM mode. Sub-routines

46

Sub-routine repetition can be programmed with P word. A maximum of 99 repetitions are possible. Sub-routine nesting 3 levels of nesting of sub-routines is allowed.

46

You might also like