What Is CNC?

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 90

What is CNC?

 CNC stands for Computer Numerical Control.

 Itis 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.
    
 Themost 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

Computer User
Axis servo Interface
controller
Numerical
(key board,monitor)
Control

Programmable
Machine
controller

Machine Tool
Servo Slide
Motor

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.
x

Z axis

X axis
z
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 Program Stop Temporary stop of program
M01 Optional Stop Temporary stop of program ( Optiontion Stop )
M02 Program end Program end and reset
M03 Spindle normal rotation Clockwise rotation of spindle
M04 Spindle reverse rotation Counter clockwise rotation of spindle
M05 Spindle Stop Spindle rotation stop
M06 Tool Change ATC Cycle start
M08 Coolant ON Coolant Discharge
M09 Coolant OFF Coolant shut
M22 Index Forward Turret index clockwise
M23 Index Reversed Turret index counter clockwise
M24 Chuck open Opening of chuck
M25 Chuck close Closing of chuck
M30 Program end and rewind Program end and reset/rewind
M98 Sub-program call Call of a sub-program from a main program
M99 Sub-program end Return from a sub-program to a main program
G Codes

 G00 Positioning (Rapid Traverse)


 G01 linear interpolation(Cutting feed)
 G02 Circular interpolation (CW)
 G03 Circular interpolation (CCW)
 G04 Dwell
 G20 Input in inches
 G21 Input in millimeters
 G28 Return to reference point
 G32 Thread cutting
 G40 Tool nose radius compensation cancel
 G41 Tool nose radius compensation left
 G42 Tool nose radius compensation right
 G50 Programming of absolute zero point
 G50 Maximum spindle speed setting
 G70 Finishing cycle
 G71 Stock removal in turning
 G72 Stock removal in facing
 G73 Pattern repeating
 G74 Peck drilling cycle - z axis
 G90 Absolute programming
 G91 Incremental programming
 G92 Thread cutting cycle
 G96 Constant surface speed control
 G97 Constant surface speed control cancel
 G98 Per minute feed
 G99 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 END OF BLOCK


NUMBER

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; CSS control cancel
G96 S200;
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.
“ Let’s 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(-) z (+)
Work Zero

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)

N_ G02 X_ Z_ R_ F_
Z axis

The G02 is a clockwise GO2


radial feed move
X axis
G03 Circular interpolation (ccw)

N_ G03 X_ Z_ R_ F_

Z axis
The G03 is a counter
clockwise radial GO3
feed move
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 Calls the offset Nr.02


: T0200 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 Machine
Part drawing CNC
programming 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(-) z (+)
Work Zero

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
CNC PROGRAM

FOR

TURNING CENTRE
O7130
(PILATUS PROGRAM FOR 4130
ZEN)
IF[#530NE4130]GOTO8
M98P6000
M86
Turning & facing
G04X2.0
M01
N1 (R0UGH TURNING)
T0606
G30U0.0W0.0
G50S2000
G90G00G54X105.0Z-29.55
G96G99S375M04 M08
G01X46.0F0.4
U0.5W0.25
G00U6.0
Z0.5 41.125
X48.0
G01X20.0
G00X36.625Z1.5
G01X41.125Z-0.75
Z-29.55
G00U2.0W1.0
T0000
G30U0.0W0.0
M09 29.55
M05
#506=#506+1
M01
O7130

Turning & facing


(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
Z0.5
X48.0
G01X20.0
G00X36.625Z1.5
G01X41.125Z-0.75
41.125
Z-29.55
G00U2.0W1.0
T0000
G30U0.0W0.0
M09
M05
#506=#506+1
M01 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
21.80
M01

29.55
Grooving

N6
(BOOT GROOVE)
T0303
G30U0.0W0.0
G90G00G54X44.0Z-19.85
G97G99S2000M03 19.85
M08
G01X37.625F0.25
G00X50.0
T0000
G30U0.0W0.0
M09 37.625
M05
#503=#503+1
M01
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; O1000; O2000; O3000; O4000;
. . . . .
. . . . .
. . . . .
M98P1000 M98P2000 M98P3000 M98P4000 .
. . . . .
. . . . .
. . . . .
M30; M99; M99; M99; 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. Non-Volatile.

#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

Referencingthevariablesinapartprogram.

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 #4001=01
G02 #4002=02
G03 #4002=03
Thank
you

You might also like