Sie sind auf Seite 1von 90

What is CNC?

CNC stands for Computer Numerical Control. It is a versatile system that allows you to control the motion of tools and parts through computer programs that use numeric data. CNC can be used with nearly any traditional machine.

The most common CNC machines found in the machine shop include machining centers (mills) and turning centers (lathes).
CNC finds applications in other processes such as sheet metal working, non-traditional machining and inspection. Robots and Rapid Prototyping machines are also CNC controlled

CNC Vs Automates

Automats and Special Purpose Machines (SPMs) require special cams / templates and clutch settings for each part. Manufacture of these cams / templates is costly and slow. Furthermore, changing over from one part to the other on these machines also consumes considerable time. The high cost and long time of these hard automated machines to produce parts can be justified only in mass production. These are avoided with CNC

Advantages of CNC

Flexibility Accuracy Speed Simplified fixture and generic cutting tools Storage of machining skill in NC programs Less skilled operators will do Less fatigue to the operators

BASIC FUNCTIONAL BLOCKS OF A CNC MACHINE

Axis servo controller

Computer Numerical Control

User Interface (key board,monitor)

Programmable Machine controller Machine Tool Slide Encoder

Popular CNC Controls

Fanuc Sinumeric from Siemens Heidenhain Allen Bradley etc We will discuss only FANUC .

What is a turning center?

Turning center A sophisticated CNC machine that specializes in turning, boring, drilling, and threading operations, all at the same location. Spindle The part of the machine tool that spins. On the turning center, the spindle holds the work piece, On the machining center, the spindle holds a cutting tool.

Turret This holds the tools required for machining.


Usually on a turret in the rear, most lathes have 8 to 12 tools on a single, indexing turret. Gang-type lathes have no turret, tools are mounted on a cross-slide for short motions.

Axis
This is the moving slide, and a turning center has a minimum of two axes.(named X and Z). controlled by the CNC. The turret is mounted on the axes in such a way that,The tool can be moved in both directions.

Z axis

X axis

Turning center Operations


Facing Turning Drilling Boring Grooving on OD or ID Face grooving Chamfering Thread Cutting Etc.,,

Functions
Auxiliary function ( M functions) Preparatory functions ( G functions)

Spindle function
Feed function Tool function

M codes

M codes are used for doing auxiliary machine functions. It is designated by M followed by No.
Example

M08 Coolant On M06 Tool change

M00 M01 M02 M03 M04 M05

Program Stop Optional Stop Program end Spindle normal rotation Spindle reverse rotation Spindle Stop

Temporary stop of program Temporary stop of program ( Optiontion Stop ) Program end and reset Clockwise rotation of spindle Counter clockwise rotation of spindle Spindle rotation stop

M06
M08 M09 M22

Tool Change
Coolant ON Coolant OFF Index Forward

ATC Cycle start


Coolant Discharge Coolant shut Turret index clockwise

M23
M24 M25 M30 M98 M99

Index Reversed
Chuck open Chuck close Program end and rewind Sub-program call Sub-program end

Turret index counter clockwise


Opening of chuck Closing of chuck Program end and reset/rewind Call of a sub-program from a main program Return from a sub-program to a main program

G Codes

G00 G01 G02 G03 G04 G20

Positioning (Rapid Traverse) linear interpolation(Cutting feed) Circular interpolation (CW) Circular interpolation (CCW) Dwell Input in inches

G21 G28 G32 G40 G41 G42

Input in millimeters Return to reference point Thread cutting Tool nose radius compensation cancel Tool nose radius compensation left Tool nose radius compensation right

G50 G50 G70 G71 G72 G73

Programming of absolute zero point Maximum spindle speed setting Finishing cycle Stock removal in turning Stock removal in facing Pattern repeating

G74 G90 G91 G92 G96 G97 G98 G99

Peck drilling cycle - z axis Absolute programming Incremental programming Thread cutting cycle Constant surface speed control Constant surface speed control cancel Per minute feed Per revolution feed

What is programming?

Programming is telling the machine by command data through numerical control for its working of its components. Example : Movement of Turret.. Rotation of spindle etc

Program block
A program block is a combination of above functions in a single line.

Example

: N01 G01 G91 X0.0 Y10.0 S2000 M03 ;

SEQUENCE NUMBER

END OF BLOCK

Line number is optional End of block is mandatory

Sequence Number
Designated as N1 or N10 etc Used to identify the blocks Not mandatory Occupies memory Can be used for each process rather than for each block

What are various Functions ?

Spindle speed Function


The spindle speed can be specified by a S code followed by a Numerical value (rpm).

Syntax

:S

Example

: S2000 M03;

Usually S command is associated with M03 or M04 to specify the direction of rotation CW or CCW

CONSTANT SURFACE SPEED CONTROL (CSS CONTROL)

As you know when the tool is moving towards the center the cutting speed changes.
Vc = DN/1000

In CSS control N is varied automatically to keep the Vc constant when the tool moves diametrically.
Syntax : G96 Vc; CSS Control on

G97;
G96 S200;

CSS control cancel

G96 and G97 are modal codes.Here S200 denotes the cutting speed.

CLAMP OF MAXIMUM SPINDLE SPEED

When we are using G96, the CSS control, the spindle Speed need to be clamped to a maximum speed.

This is done with a preparatory function G50

Example

: G50 S3500;

Spindle speed is clamped to a maximum of 3500 rpm.

Feed function
The feed can be specified by F code followed by a Numerical value (feed per minute / feed per revolution).

Syntax

:F

Example

: G98 F100;

: G99 F0.15;
G98 and G99 are preparatory functions to specify feed per minute and feed per revolution respectively.

Tool function
Tool selection A 2 digit / 4 digit numeric followed by a T code is used to select the required tool.

Syntax

T
Offset number Tool number

Example

T0303; Selects turret 3 with offset Nr.03 T0313; Selects turret 3 with offset Nr.13 T0300; Cancels current offset.

Lets see some G codes

G00-Rapid Positioning

G00 POSITIONING IN RAPID

N_ G00 X_ Z_
The G00 is a command for rapid traverse from a starting point to a command point.

G01 Linear interpolation


N_ G01 X_ Z_ F_
The G01 is the command by which the tool travels to the point specified with X & Z at the speed specified with F code. G01 X-50.0F0.15;

G90- Absolute command


The point with reference to the work piece zero point is referred as absolute command Always referred by G90
Example : G90 X20.0 Z20.0; Refers to a point 20mm away from the work zero in both x and z directions.

Turning center - Work coordinate principle x+


Spindle

z(-)
Work Zero

z (+)

x (-)

G91 - Incremental command


The point with reference to the present position . No reference to the work piece zero point. Always referred by G91
Example : G91 X20.0 Z20.0; Refers to a point 20 mm away from the current position in both x and z directions.

G02 Circular interpolation (cw)

Z axis

N_ G02 X_ Z_ R_ F_
The G02 is a clockwise radial feed move

GO2
X axis

G03 Circular interpolation (ccw)

N_ G03 X_ Z_ R_ F_ The G03 is a counter clockwise radial feed move

Z axis

GO3
X axis

G04 Dwell
N_ G04 U or P_

The G04 is a dwell command that halts the feed movement for the time as specified by U or P.

G20 Inch units

N_ G20 The G20 command defaults the system to inch units. When a program is being run and the G20 command is encountered, all coordinates are stated as inch units

G21 Metric units

N_ G21 The G21 command defaults the system to metric units. When a program is being run and the G21 command is encountered, all coordinates are stated in as millimeter units.

G28 Automatic return to reference point

N_ G28 U_ W_
The G28 allows the existing tool to be positioned to the machine zero point via an intermediate position.

G30 Automatic return to 2nd reference point

N_ G30 U_ W_ The G28 allows the existing tool to be positioned to the machine zero point via an intermediate position.

G50 Co ordinate setting Max spindle speed setting.

To assign the work co ordinate value as well as max spindle speed setting this command is used G 50 X_ Z_ Co ordinate setting G50 S 2500 Max spindle speed setting

G 50 X 200. Z100

100

100

G96

Constant surface speed Control

G96 is used when cutting speed is required to be specified G96 S425; Ex facing To have common cutting speed

G97

Constant surface speed control cancel


G97 is used when spindle speed is required to be specified G97 Ex Drilling To have common cutting speed

G98

Feed per minute

G98 is used to specify the tool movement in mm per minute G98 Ex bar bulling

G99

Feed per Revolution

G99 is used to specify the tool movement in mm per spindle revolution G99 Ex Regular turning

What is Tool offset?

Tool offset is a value used to compensate the difference between the actual tool and the imaginary tool (standard tool) used for programming.

Standard tool

Actual tool X offset

Z offset

Tool Geometry offset: To compensate the difference in tool shape and mounting position.

Tool Wear offset: To compensate the tool wear during running.

Example

: T0202 : T0200

Calls the offset Nr.02 Offset cancel

Structure of a CNC program

Evolution

Punched tape and input through tape reader Programming directly on the machine Programming through hand held device Programming from centralized PC

Process of Programming
Part drawing - indicates which are the characteristics to be machined
Machining plan how many set ups, fixtures, tooling, sequence of operation etc Part programming Writing program considering the machining plan

BASIC FLOW FOR CNC PREPARATION

Part drawing

Part programming

CNC

Machine tool

Programming

Operation

How to set the machine


Machine ON Origin Fixture Mounting Fixture dialing Locator/clamp fixing Tool mtg on the holders Measure the tool length Tool pocketing

Tool offset inputing Programming Find work co ordinate Dry run with out component /single block Cutting in single block Rapid /feed lesser rate Component inspection Correction of work co ordiante Correction of tool offset Component cutting @ 100% feed/ speed/Rapid

Program Number

Program number
The program no is used to arrange several programs in order The program no is expressed by putting numerals of 4 digits after the alphabet O Ex O 1234

Work piece zero point


The reference point on the work piece is called

work piece zero point.


Determine the work piece zero point wrt

drawing dimensioning or having easy reference to drawing.

Programming for Turning center


Turning center - Work coordinate principle x+
Spindle

z(-)
Work Zero

z (+)

x (-)

Basic Programming rules CNC lathe :


X = The diameter of the part. Z = The length dimension

Usually Z is set at the finished face of the part, any cut into the part is a minus value. A positive value in the program indicates it is clear of the part, a minus value indicates it is into the part.

Diametrical programming
The Diametrical value of the work piece is directly input in to the program . X 50.0

50

Optional stop and block skip

Whenever the CNC encounters the code M01 it stops at the same line.
Pressing Cycle start again will enable it to move further. A SLASH / is used to tell the machine to skip the particular block. Example: /G00 X200.0;

CNC PROGRAM FOR TURNING CENTRE

O7130 (PILATUS PROGRAM FOR 4130 ZEN) IF[#530NE4130]GOTO8 M98P6000 M86 G04X2.0 M01 N1 (R0UGH TURNING) T0606 G30U0.0W0.0 G50S2000 G90G00G54X105.0Z-29.55 G96G99S375M04 M08 G01X46.0F0.4 U0.5W0.25

Turning & facing

G00U6.0
Z0.5 X48.0 G01X20.0 G00X36.625Z1.5 G01X41.125Z-0.75 Z-29.55 G00U2.0W1.0 T0000 G30U0.0W0.0 M09 M05 #506=#506+1 M01

41.125

29.55

O7130 (PILATUS PROGRAM FOR 4130 ZEN) IF[#530NE4130]GOTO8 M98P6000 M86 G04X2.0 M01 N1 (R0UGH TURNING) T0606 G30U0.0W0.0 G50S2000 G90G00G54X105.0Z-29.55 G96G99S375M04 M08 G01X46.0F0.4 U0.5W0.25

Turning & facing

Z0.5
X48.0 G01X20.0 G00X36.625Z1.5 G01X41.125Z-0.75 Z-29.55 G00U2.0W1.0 T0000 G30U0.0W0.0 M09 M05 #506=#506+1 M01

41.125

29.55

Drilling
N2

(ROUGH C.BORE DV 2135)


T0808 G30U0.0W0.0 G90G00X0.0Z6.0 G97G99S1600M03 M08 G01Z-21.80F0.2 G00Z5.0 T0000 G30U0.0W0.0 M09 M05 #508=#508+1 M01

21.80 29.55

Grooving
N6 (BOOT GROOVE) T0303 G30U0.0W0.0 G90G00G54X44.0Z-19.85 G97G99S2000M03 M08

19.85

G01X37.625F0.25
G00X50.0 T0000 G30U0.0W0.0 M09 M05 #503=#503+1 M01

37.625

Sub program call by M98

If a program contains a fixed sequence or frequently repeated pattern such a sequence or pattern can be stored as a sub program in memory to simplify the program.

A sub program can be called from a main program

A called sub program can also call another subprogram.

EXAMPLE:
O0001; . . . M98P1000 . . . M30; O1000; . . . M98P2000 . . . M99; O2000; . . . M98P3000 . . . M99; O3000; . . . M98P4000 . . . M99; O4000; . . . . . . . M99;

programmable data input - G10

Offset values can be changed during run time from inside the program by using programmable data input G10 command.

Syntax : G10 P_X_Z_; G10 P_U_W_;

Writing Comments in a program

Any information enclosed by a set of circular brackets () is regarded as a comment and the CNC skips that line.
Comments are useful to describe the section of the program. Example: O0001; (Main program for part 29665688-Pilatus); N1;

T0101;
(Rough turning TCGX102-AL804);

Custom Macro

You are aware that sub programs are useful for repeating the same operation.

Custom macro function allows use of variables,arithmetic and logical operations and conditional branches for easy development of general programs.

It is useful to develop custom designed canned cycles.

They are very useful in generating alarms under stated conditions.

Macro Variables:

Macro variables are the memory locations on the CNC memory used to store some data. Similar to POINTERS Concept in computer programming

The variable number is a pointer to the address of the stored memory location.

A macro variable is always prefixed with a symbol. Example : #100

Arithmetic expressions can be used to store the values into macro variable. Example #100 = #112-12;

Types of variables
Null variable #0 is always represents a zero;

Local variables #1 to #33 are temporary locations to store results. Volatile.


Common variables #100 - #199 they can be shared among many programs. Volatile. Common variables #500-#999 are common variables. NonVolatile. #1000 System variables used to read and write NC data items like pallet in work zone, tool number, axis current position etc.,

Variable values -1047 to -10-29 0 10-29 to 1047

Referencing the variables in a part program.

N1 G01 X#500 F#501; N2 S#503;

Macro alarms

We can build our own alarms using macro

#3000=1(TOOL OFFSET WRONG);

Will stop the machine and display an alarm in the screen


3001 TOOL OFFSET WRONG

The current position of each axis is available in a macro

#5021 gives the machine current position for X #5022 gives the machine current position for Y

#5081 and #5082 gives tool offset value.

Arithmetic operations

Sum,Difference,Product and Quotient can be performed.

For example

#500 = #500+1;

Trigonometric and logarithmic operations

#I=SIN [#j];

#I=COS [#j];
#I=TAN [#j];

#I=SQRT [#j]; #I=ABS [#j]; #i=LN [#j]; #I=EXP [#j];

Conditional branch

IF [#100 GT 10] GOTO 2;


EQ = EQUAL TO

NE= NOT EQUAL TO


GT= GREATER THAN GE= GREATER THAN OR EQUAL LT= LESS THAN LE= LESS THAN OR EQUAL

BRANCHING EXAMPLE

O0003; IF[#530 NE 5142] GOTO7; . . . . . . N7;


IF[#501GT5000]#3000=1(TOOL LIFE END);

WHILE STATEMENT

WHILE [conditional expression] DO m;

End m;

G CODE INFORMATION

The present value of a modal G code can be read from a macro variable.
If the machine is in G00 mode then #4001=00 G01 G02 G03 #4001=01 #4002=02 #4002=03

Thank you

Das könnte Ihnen auch gefallen