Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction To CNC-Programming

Similar presentations


Presentation on theme: "Introduction To CNC-Programming"— Presentation transcript:

1 Introduction To CNC-Programming

2 Topics Basics Types Structure of a program Common G and M Codes
Analyzing a Code

3 Basics What is G-Code? What is M-Code? Geometric code
G-code is a language used to communicate to a CNC machine. It tells the machine how to move and what commands to execute. It is a way for a machinist to tell a CNC machine what to do. What is M-Code? Miscellaneous code Examples: coolant, spindle speed, clockwise, counterclockwise and changing to a specific tool number, etc.

4 Basics Significance Supreme accuracy and precession
Automation to reduce the need of manual labor and skill Reduces manufacturing cycle time Complex and sophisticated manufacturing Mistake proofing and continuous flow

5 Types of program Basic G-coding can be categorized into two types:
Turn (Lathe machine) Does operations such as turning, parting, facing, contouring, drilling etc. Mill (Vertical milling machine) Does operations such as slot cutting, drilling, design on plate, a lot of other applications. Don’t get anxious if you are lost. It will be clear as we take some examples

6 Examples Turn Cutting view After each cut Final Object

7 Examples Mill Final Object

8 Types of program (contd..)
According to axis it can be: 2 axis (Turn ---X, Y) 3 axis (Mill ---X, Y, Z) 4 axis (Combined) 5 axis (Combined) Let’s take examples !

9 2 Axis 3 Axis 4th (A) & 5th (B) Axis

10 Tips X= Horizontal Y= Vertical Z= Up and down or depth
A= Rotation about X B= Rotation about Y The number beside either x, y or z in the G-Code language is the distance it travels in that general axis.

11 Layout of a program % (it means the start of program)
Program number (reference) Safety codes (safety codes to cancel presets) Stock definition Tool change Move to position Spindle turns on Coolant turns on Cutting begins End of program Reset

12 Frequently used G Codes and their use
G00 --Rapid move to position---Quickly travels to the position specified by X, Y, Z G01– Move to position while cutting– Reaches position specified by X, Y, Z while making cut G02– Making clockwise cut– Makes arc/round cut G03– Making anticlockwise cut--Makes arc/round cut G17– XY plane– If the plane is changed due to previous program it will again return to XY G90– Absolute distance– Always considers from 0,0,0 G54– Cancel offset– Previous offset of 0,0,0 will be cancelled G40– Cancel tool radius offset G49– Cancel tool length offset G94– Feed per minute G41– tool compensation left of cut (looking from behind)– Considers the tool radius G42-- tool compensation right of cut (looking from behind) G43– tool length compensation – Considers the tool length G80-- Cancel all canned cycle– Canned cycle is used to do multiple similar works like drilling in different positions with same parameters G83– Pecking canned cycle– Used for peck drilling G91– Incremental movement– Adds the given value with previous position G04– Dwell– Stays in the specified position for given time. Its calculated as 1000th of a second. So 4000 will mean 4 second. G20– Unit in inch G21– Unit in mm

13 Frequently used M Codes and their use
M03– Spindle start clockwise M05– Spindle stop M06– Tool change M08– Coolant start M04-- Spindle start anticlockwise M00– Program stop M09– Coolant stop

14 Tips The codes sometime differ for different controls/machines
The best way to deal with it is to know the machine We can know our machine by running trials with standard codes. Practicing makes it easy to remember the G and M codes.

15 We will do coding for this object !

16 Lets analyze the program
1 2 3 4 5 6 The pictures above shows the process in brief

17 Code % (STOCK/BLOCK,3.5,2,.51,0,0,1) O1000 (Program Number) (Start of safety code) G20 G17 G40 (G20 inch/G21 Metric, XY plane, cancel cutter compensation) G49 G64 G80 (Cancel tool length compensation, normal cutting mode, cancel canned cycles) G90 G94 G98 (absolute mode, feed per minute, initial plane for canned cycles) (end of safety code) (TOOL/MILL,2,0,5,0) (COLOR,128,255,255) M6 T20 G00 X0 Y0 Z0 T20 S2250 M03 M08 G01 Z-.51 F25 X3.5 Y.5 X0 Y1 Y1.5 Z1 M05 M09 (TOOL/MILL,0.5,0,5,0) (COLOR,0,128,128) M6 T1 G00 X-.25 Y1.06 S7500 M03 M08 G01 Z-1.1 F75 Y.38 G03 R.625 X.38 Y-.25 G01 X3.13 G03 R.625 X3.75 Y.38 G01 Y1.4 Z1 G00 X3.42 Y1.28 G01 Z-1.1 G02 X2.78 Y1.92 I-.17 J.47 G01 Z1 G00 X3.46 Y2.25 X.38 G03 R.625 X-.25 Y1.63 G01 Y.5 M05 M09 (TOOL/DRILL,0.375,120,5) (COLOR,0,0,0) M06 T2 G00 X.75 Y.5 Z-.25 S2200 M03 M08 G83 X.75 Y.5 Z-1.3 R-.475 Q.125 P4000 F12 X1.48 X2.25 X.75 Y1.25 M00

18 Lets breakdown the program to discuss
% (STOCK/BLOCK,3.5,2,.51,0,0,1) O1000 (Program Number) 1 (Start of safety code) G20 G17 G40 (G20 inch/G21 Metric, XY plane, cancel cutter compensation) G49 G64 G80 (Cancel tool length compensation, normal cutting mode, cancel canned cycles) G90 G94 G98 (absolute mode, feed per minute, initial plane for canned cycles) (end of safety code) (TOOL/MILL,2,0,5,0) (COLOR,128,255,255) M6 T20 G00 X0 Y0 Z0 T20 S2250 M03 M08 2 G01 Z-.51 F25 X3.5 Y.5 X0 Y1 Y1.5 Z1 M05 M09 (TOOL/MILL,0.5,0,5,0) (COLOR,0,128,128) M6 T1 G00 X-.25 Y1.06 S7500 M03 M08 G01 Z-1.1 F75 Y.38 G03 R.625 X.38 Y-.25 G01 X3.13 G03 R.625 X3.75 Y.38 G01 Y1.4 Z1 G00 X3.42 Y1.28 G01 Z-1.1 G02 X2.78 Y1.92 I-.17 J.47 3 G01 Z1 G00 X3.46 Y2.25 X.38 G03 R.625 X-.25 Y1.63 G01 Y.5 M05 M09 (TOOL/DRILL,0.375,120,5) (COLOR,0,0,0) M06 T2 G00 X.75 Y.5 Z-.25 S2200 M03 M08 G83 X.75 Y.5 Z-1.3 R-.475 Q.125 P4000 F12 4 X1.48 X2.25 X.75 Y1.25 M00

19 1 % (STOCK/BLOCK,3.5,2,.51,0,0,1) O1000 (Program Number)
(Start of safety code) G20 G17 G40 (G20 inch/G21 Metric, XY plane, cancel cutter compensation) G49 G64 G80 (Cancel tool length compensation, normal cutting mode, cancel canned cycles) G90 G94 G98 (absolute mode, feed per minute, initial plane for canned cycles) (end of safety code) % indicates the start of the program. In some controls it is ignored. Then there is the definition of stock. The initial object for machining. 3.5X2X.51 Machine initial position is 0,0,1 Now it’s the program number which will help us recognize the program in the machine Now the safety codes These will cancel memory from previous operation and set the parameters for this program such as unit (G20), Plane (G17), feed (G94), travel mode (G90).

20 2 Y.38 (top part facing) (TOOL/MILL,2,0,5,0) (COLOR,128,255,255)
T20 M6 G00 X0 Y0 Z0 T20 S2250 M03 M08 G01 Z-.51 F25 X3.5 Y.5 X0 Y1 Y1.5 Z1 M05 M09 (Profiling) (TOOL/MILL,0.5,0,5,0) (COLOR,0,128,128) M6 T1 G00 X-.25 Y1.06 S7500 M03 M08 G01 Z-1.1 F75 Y.38 Defines the tool geometry. In the bracket the yellow number 2 means diameter and then there is height 5 Color code for the tool These are for visualization in simulation. These will not go in to the machines Then there is the command for tool change to ‘Tool 20’. M6 stands for tool change. Then G00 is asking the tool 20 to rapidly go to 0,0,0 and then the spindle starts. M03 means clockwise rotation of spindle and ‘S’ specifies the speed M08 means coolant start G01 is asking the tool to go to the specified position while cutting. ‘F’ indicates the feed rate. G01 continues and no need to write again and again. The tool travels to the specified positions in X, Y and Z while cutting. Facing of the top part is being done. Now the machine needs to stop for tool change. M05 stops the machine and M09 stops the coolant. M6 changes the tool to tool 1 G01 is asking rapid positioning to the specified location. Spindle starts with speed 7500 and rotating in clockwise direction. Coolant starts as well. G01 indicated moving to the location while cutting as the tool and speed has changes we have a different requirement for feed. Cutting continues on y axis. A straight travel has been completed and now it will turn the corner with a radius.

21 3 G03 R.625 X.38 Y-.25 G01 X3.13 G03 R.625 X3.75 Y.38 G01 Y1.4 Z1 G00 X3.42 Y1.28 G01 Z-1.1 G02 X2.78 Y1.92 I-.17 J.47 G01 Z1 G00 X3.46 Y2.25 X.38 G03 R.625 X-.25 Y1.63 G01 Y.5 M05 M09 A straight travel has been completed and now it will turn the corner with a radius G03 means turning corner counter clockwise. R is the radius of travel. And specified X,Y is the end point First positioning the tool then direction, radius and end position. This is the sequence. Then again a straight cut and round corner and again a straight cut (G01 Y1.4). After that the tool moves up (use G01 to avoid collition) to take position for the cutting with ‘I’ and ‘J’. Rapid positioning and then tool climbs down cutting. Tool is in start position for the round cut. G02 for clockwise cut. X,Y denotes the end position and then I indicated the start position from center of arc along X axis. And J indicated the Y value. These are not co-ordinates these are lengths. After that the tool moves up, takes another position for profiling a straight cut and then makes another counter clockwise round cut. Radius coordination system has been used for this one. After this tool makes another straight cut and climbs up and stops for tool change. Coolant is also stopped.

22 4 Tool is changed to a drill.
(TOOL/DRILL,0.375,120,5) (COLOR,0,0,0) M06 T2 G00 X.75 Y.5 Z-.25 S2200 M03 M08 G83 X.75 Y.5 Z-1.3 R-.475 Q.125 P4000 F12 X1.48 X2.25 X.75 Y1.25 G01 Z1 M05 M09 M00 Tool is changed to a drill. G00 performed rapid positioning for drilling Canned cycle has been used to avoid coding for repeating task G83 has been used as the requirement is peck drilling. X,Y gives the drill position, Z gives the final depth, R gives the retract height in drilling, Q gives the pecking depth, P gives he dwell time in final depth for smoothing the hole and F gives the feed rate. As we used the canned cycle we do not need to write the specifications again. Just providing the next drill location does the job After the drilling the tool climbs up and spindle is stopped as well as the coolant supply. M00 indicates the end of the program.

23 THANK YOU


Download ppt "Introduction To CNC-Programming"

Similar presentations


Ads by Google