Вы находитесь на странице: 1из 10

Manufacturing Engineering Section

Department of Mechanical Engineering Indian Institute of Technology Madras


Course Name: Machining and Metrology lab Course No: ME3290

Name of the experiment:


PROGRAMMING AND MACHINING USING CNC TURNING CENTRE

Aim: To write manual part-program for machining an axisymmetric work specimen in a twoaxes CNC turning centre. Theory: CNC lathes are preferred over the older production lathes (multi-spindle, etc.) due to their ease of setting, operation, repeatability and accuracy. They are designed to use modern carbide tooling and fully use modern processes. The part may be designed and the tool paths programmed by the CAD/CAM process or manually by the programmer and the resulting file uploaded to the machine, and once set and trialled the machine will continue to turn out parts under the occasional supervision of an operator. The machine is controlled electronically via a computer menu style interface; the program may be modified and displayed at the machine, along with a simulated view of the process. The design of a CNC lathe varies with different manufacturers, but they all have some common elements. The turret holds the tool holders and indexes them as needed, the spindle holds the work-piece and there are slides that let the turret move in multiple axes simultaneously. The machines are often totally enclosed, due in large part to Occupational health and safety (OH&S) issues.

Programming fundamentals: Machining involves an important aspect of relative movement between cutting tool and workpiece. In lathe this is accomplished by moving the tool with respect to workpiece. A program defining motion of tool / workpiece in this coordinate system is known as a Part Program.

1. Reference Points Part programming requires establishment of some reference points. Three reference points are either set by manufacturer or user. a) Machine Origin - The machine origin is a fixed point set by the machine tool builder. Usually it cannot be changed. Any tool movement is measured from this point. The controller always remembers tool distance from the machine origin. b) Program Origin - It is also called home position of the tool. Program origin is point from where the tool starts for its motion while executing a program and returns back at the end of the cycle. This can be any point within the workspace of the tool which is sufficiently away from the part. In case of CNC lathe it is a point where tool change is carried out. c) Part Origin - The part origin can be set at any point inside the machine's electronic grid system. Establishing the part origin is also known as zero shift, work shift, floating zero or datum. Usually part origin needs to be defined for each new setup. Zero shifting allows the relocation of the part. Sometimes the part accuracy is affected by the location of the part origin.

Fig.1 Reference origins and axes convention

2. CNC Code Syntax N100 G01 X20.0 Z3.0 The above line represents a typical CNC code. The format specifies the order and arrangement of information entered. This will be discussed in detail in following sections.

3. Types of CNC codes a) Preparatory code - The term "preparatory" in NC means that it "prepares" the control system to be ready for implementing the information that follows in the next block of instructions. A preparatory function is designated in a program by the word address G followed by two digits. Preparatory functions are also called G-codes and they specify the control mode of the operation. b) Miscellaneous codes - Miscellaneous functions use the address letter M followed by two digits. They perform a group of instructions such as coolant on/off, spindle on/off, tool change, program stop, or program end. They are often referred to as machine functions or M-functions. In principle, all codes are either modal or non-modal. Modal code stays in effect until cancelled by another code in the same group. The control remembers modal codes and gives an opportunity to save programming time. Non-modal code stays in effect only for the block in which it is programmed. Afterwards, its function is turned off automatically. Commands known as "canned cycles" (a controller's internal set of pre-programmed subroutines for generating commonly machined features such as internal pockets and drilled holes) are non-modal and only function during the call. 4. Programming modes There are different categories of programming modes. a) Absolute programming (G90) - All measurements are made from the part origin set up by the operator. Any programmed coordinate has the absolute value w.r.t. the absolute coordinate system zero point. The machine control uses the part origin as the reference point in order to position the tool during program execution. b) Incremental programming (G91) - The tool movement is measured from the last tool position. The programmed movement is based on the change in position between two successive points. The coordinate value is always incremented according to the preceding tool location. The programmer enters the relative distance between current location and the next point.

Fig.2 a) Absolute programming

b) Incremental programming

c) Diameter / Radius programming It is common for CNC turning centres to allow Xcoordinates to be programmed as diameter values rather radius values. This only affects Xcoordinates. Diameter coordinates are more convenient than the radius values; this can help to avoid the simple math errors that can occur when diameter is divided into half to obtain radius E.g. - To machine a work-piece to diameter 1.75 In Diameter programming In Radius programming 5. Tool selection Tool selection is accomplished using 'T' function followed by a four digit number where, first two digits are used to call the particular tool and last two digits are used to represent tool offset in the program. The tool offset is used to correct the values entered in the coordinate system preset block. a) Tool nose radius compensation : G01 X1.75 Z-1.0 : G01 X0.875 Z-1.0

Fig.3 Tool nose radius compensation Most finish-turning operations should be performed with the aid of automatic cutter compensation. This allows the control to make minute adjustments to the tool tip position in order to accurately produce the machined features within print specifications. If the program does not compensate for the tool nose radius the part will be cut under / over size. The solution is to program the desired tool path relative to the centre of the cutter. When programming a lathe, use the centre of the tool nose radius. Cutter compensation for turning can be offset to the left or right side of the programmed tool path with the G41 and G42 codes respectively. It can be cancelled with the G40 code.

b) Tool length/offset compensation Additional tool offsets are required because of the varying sizes of the cutting tools. Each offset is the difference between the cutting edge locations relative to the zero-setting tool. A tool presetter is used to determine the X and Z offset values before the machining operation and stored in memory.

Fig.4 Tool offsets for different tools

6. Sample programs: a) Problem 1

Fig.3

O5678 N02 G21 N03 M03 S1000 N04 G00 X0 Y0 N05 G00 Z-10.0 N06 G01 X50.0 N07 G01 Y20.0 N08 G02 X25.0 Y45.0 R25.0 N09 G03 X-25.0 Y45.0 R25.0 N10 G02 X-50.0 Y20.0 R25.0 N11 G01 Y0.0 N12 G01 X0.0 N13 G00 Z10.0 N14 M05 M09

Program number Metric programming Spindle start clockwise with 1000rpm Rapid motion towards (0,0) Rapid motion towards Z=-10 plane Linear interpolation Linear interpolation Circular interpolation clockwise (cw) Circular interpolation counter clockwise (ccw) Circular interpolation clockwise (cw) Linear interpolation Linear interpolation Rapid motion towards Z=10 plane Spindle stop and program end

b) SUBROUTINES Any frequently programmed order of instruction or unchanging sequences can benefit by becoming a subprogram. Typical applications for subprogram applications in CNC programming are

Repetitive machining motions Functions relating to tool change Hole patterns

Structurally, subprograms are similar to standard programs. They use the same syntax rules. The benefits of subroutines involve the reduction in length of program, and reduction in program errors. There is a definition statement and subroutine call function. Standard sub-routine N10 N20 N30 . N70 G22 N5 N80 N90 . N100 G24 . N160 G20 N5 In the above example G22 statement defines the start block of the sub-routine and G24 marks the end of the sub-routine statement. The subroutine is called by another code G20 identified by the label N5. c) CANNED CYCLES A canned cycle is a preprogrammed sequence of events / motions of tool / spindle stored in memory of controller. Every canned cycle has a format. Canned cycle is modal in nature and remains activated until cancelled. Canned cycles are a great resource to make manual programming easier. Machining a Rectangular pocket: (example for a milling operation) This cycle assumes the cutter is initially placed over the center of the pocket and at some clearance distance (typically 0.100 inch) above the top of the pocket. Then the cycle will take over from that point, plunging the cutter down to the "peck depth" and feeding the cutter around the pocket in ever increasing increments until the final size is attained. The process is repeated until the desired total depth is attained. Then the cutter is returned to the center of the pocket at the clearance height as shown in figure. The overall length and width of the pocket, rather than the distance of cutter motion, are programmed into this cycle.

The syntax is: G87 Xx Yy Zz Ii Jj Kk Bb Cc Dd Hh Ll Ss (This g code controller). Description: x,y z i j,k b c d h l s is entirely controller specific and the syntax may vary between controller to

Center of the part Distance of the reference plane from top of part Pocket depth Half dimensions of the target geometry (pocket) Step depth Step over Distance of the reference plane from top of part Feed for finish pass Finishing allowance Speed

For machining a circular pocket, the same syntax with code G88 is used.

List of G-codes commonly found on Fanuc and similarly designed controls Code G00 G01 G02 G03 G04 G07 G09 G10 G11 G12 G13 G17 G18 G19 G20 G21 G28 G30 G31 G32 G33 G34 G40 G41 G42 G43 G44 G45 G46 G47 G48 G49 G50 G52 G53 G54 to G59 G70 G71 G72 G73 G74 G74 G75 Description Rapid positioning Linear interpolation Circular interpolation, clockwise Circular interpolation, counterclockwise Dwell Imaginary axis designation Exact stop check Programmable data input Data write cancel Full-circle interpolation, clockwise Full-circle interpolation, counterclockwise XY plane selection ZX plane selection YZ plane selection Programming in inches Programming in millimeters (mm) Return to home position (machine zero) Return to secondary home position Skip function (for probes and tool length measurement) Single-point threading, longhand style Constant-pitch threading Variable-pitch threading Tool radius compensation off Tool radius compensation left Tool radius compensation right Tool height offset compensation negative Tool height offset compensation positive Axis offset single increase Axis offset single decrease Axis offset double increase Axis offset double decrease Tool length offset compensation cancel Define the maximum spindle speed Local coordinate system (LCS) Machine coordinate system Work coordinate systems (WCSs) Fixed cycle, multiple repetitive cycle, for finishing (including contours) Fixed cycle, multiple repetitive cycle, for roughing (Z-axis emphasis) Fixed cycle, multiple repetitive cycle, for roughing (X-axis emphasis) Fixed cycle, multiple repetitive cycle, for roughing, with pattern repetition Peck drilling cycle for turning Tapping cycle for milling, left-hand thread, M04 spindle direction Peck grooving cycle for turning

G76 G76 G80 G81 G82 G83 G84 G90 G91 G92 G92 G94 G95 G96 G97 G98 G99

Fine boring cycle for milling Threading cycle for turning, multiple repetitive cycle Cancel canned cycle Simple drilling cycle Drilling cycle with dwell Peck drilling cycle (full retraction from pecks) Tapping cycle, right-hand thread, M03 spindle direction Absolute programming Incremental programming Position register (programming of vector from part zero to tool tip) Threading cycle, simple cycle Feed-rate per minute Feed-rate per revolution Constant surface speed (CSS) Constant spindle speed Feed-rate per minute (group type A) Feed-rate per revolution (group type A)

List of M-codes commonly found on Fanuc and similarly designed controls Code M00 M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M13 M19 M21 M22 M23 M30 M41 M42 M52 M60 M98 M99 Description Compulsory stop Optional stop End of program Spindle on (clockwise rotation) Spindle on (counterclockwise rotation) Spindle stop Automatic tool change (ATC) Coolant on (mist) Coolant on (flood) Coolant off Pallet clamp on Pallet clamp off Spindle on (clockwise rotation) and coolant on (flood) Spindle orientation Mirror, X-axis Mirror, Y-axis Mirror OFF End of program with return to program top Gear select - gear 1 Gear select - gear 2 Unload Last tool from spindle Automatic pallet change (APC) Subprogram call Subprogram end

Вам также может понравиться