Showing posts with label CNC Mill. Show all posts
Showing posts with label CNC Mill. Show all posts

Thursday, November 15, 2018

Linear Pattern G72.2

We have seen how the circular copy of the program is done. Now we will see how the linear of the program is copied. 

Just like a copy of a program circular is done in a linear copy. 

Only a few changes are made in the circular copy, the rest is just like the circular program. So let's see the linear copy of the program.


The programming format is

G72.2...P...L...I...J...R...



L is a no. of program in linear(compulsory)
I is program shift in X direction
J is program shifting in Y direction







Main Program

%
O0001
N1 G0 G90 G54 X0 Y0 M3 S200 (Point A)
N2 Z5
N3 G01 Z0 F300
N4 X10 Y25 (Point B)
N5 G72.2 P0002 L3  I50
N6 G90 G01 X180 Y25 F300
N7 G0 Z100
N8 M30
%

Subprogram

O0002
N1 G91 G01 X20  (Point C)
N2 Y30 (Point D)
N3 X30 (Point E)
N4 Y-30 (Point F) 
N5 M99
%

Monday, November 5, 2018

Circular Milling Using Macro Variable


All parameter in form of variable while you make a program of circular milling. 

You just have to set only cutter diameter and hole diameter. This program is automatically calculate path of rotation.

Now see step by step what i did.

Hole Milling

%

O0001
N1 #100=12 (Hole Diameter)
N2 #101=8 (Cutter Diameter)
N3 #102=#100 - #101 (Center Distance)
N4 #103=#102/2 (Calculation)
N5 #104=1 (First Depth of cut)
N6 #105=1 (Global Depth of cut)
N7 #106=15 (Total Depth of cut)

N8 G0 G91 G28 Z0
N9 G90 G54 X0 Y0 M03 S2000
N10 Z5
N11 WHILE[#104LE#106]DO1

N12 G1 Z-#104 F200
N13 X-#103
N14 G03 X#103 I#103
N15 X-#103 I-#103
N16 #104=#104+#105
N17 END1

N18 G01 Z5 F200
N19 G0 G91 G28 Z0
N20 M05
N21 M30
%

Here i make only program for hole milling while i using climb milling, but whenever you make a program for boss milling you should change parameter of above program. 

There are only two changes made in program in line no. 3 and line no. 14.

Now we are using G02 for climb boss milling and  equation should be like this  #102=#100+#101 instead of subtraction. 

Saturday, November 3, 2018

Loop: While...Do...


While Do loop is used when a pass in a program is constantly repeat.


There are main three logic are used in this loop.

LT: Less than
LE: Less than or equal to
GT: Greater than
GE: Greater than or equal to

For example
from XOYO (Left Front Corner)to

N01 X200
N02 Y100
N03 X0
N04 Y0

Here shown program is rectangular single planner pass at some height. Now this pass is continuously repet in at some depth. So the conventional program like. If depth of cut is 5 mm(only for understanding) and depth is 15 mm than

%
O0001
N1 G0 G91 G28 Z0
N2 G90 G54 X0 Y0 M03 S2000
N3 Z5
N4 G01 Z-5 F200
N10 X200
N11 Y100
N12 X0
N13 Y0
N14 Z-10
N15 X200
N16 Y100
N17 X0
N18 Y0
N19 Z-15
N20 X200
N21 Y100
N22 X0
N23 Y0
N29 Z5
N30 G0 G91 G28 Z0
N31 M05
N32 M30
%

So now the While...DO... program is done in such a way.

%
O0001

#100=5 (First depth of cut variable)
#101=5 (Global depth of cut variable)
#102=15 (Total Depth)

G0 G91 G28 Z0
G90 G54 X0 X0 M03 S2000
WHILE[#100LE#102]DO1 (Looping below pass until #100 does not get less than or equal to #102)
G1 Z-#100 F200
X200
Y100
X0
Y0
#100=#100+#101 (additional for next cut)
END1 (loop end)

Z5
G0 G91 G28 Z0
M05
M30
%

Simulation




Thursday, November 1, 2018

Simple Calculation for Hole and Boss Milling

During hole and boss milling there are center distance of cutter axis and hole/boss center is very important.

This CD is defined the pitch circle diameter of cutter rotation. One condition is affect on hole milling that the cutter diameter is greater than half of hole diameter and stating point of program must be at center of hole/boss.

Formula of hole milling from the fig.


CD= (Hole Diameter - Cutter Diameter)/2


For Boss milling

CD= ( Boss Diameter + Cutter Diameter)/2

For example

The hole is 12mm of Dia. and cutter Dia. is 8mm than...

  • CD = (12-8)/2
  • CD = 2

Program:

N01 G01 X2 F200
N02 G03 X-2 R2
N03 X2 R2

And if Boss dia. is 15mm and cutter dia. 10mm than
  • CD =(15+10)/2
  • CD = 12.5

Program:

N01 G01 X-12.5 F200
N02 G02 X12.5 R12.5
N03 X-12.5 R12.5

Sunday, October 28, 2018

Circular Pattern G72.1

Often the program comes in a circular pattern. Which often seems to be repetitive. Let's learn how to copy it instead of doing it. 

When a program is rotated in a circular fixed degree, the G72.1 is used. You see how the subprogram is linked to the Maine program. In the same way, it is also linked to the subprogram and to copy it in a fixed degree.

The programming format is 

G72.1...P...L...X...Y...R...


L is a no. of program in rotation(compulsory)
R is degree between two program(compulsory)

Note : The program gets easy if your starting point of program is same with end point of program after completion of rotation copy.

G16,G17, G18, G19, G28, G51, G51.1 must not be specified in this program.





Main Program

%
O0001
N1 G0 G90 G54 X65 Y-37.53 M3 S200 (Point A)
N2 Z5
N3 G01 Z0 F300
N4 X31.681 Y-18.291 (Point B)
N5 G72.1 P0002 L6 R60 X0 Y0
N6 G90 G01 X65 Y-37.53 F300 (Point A)
N7 G0 Z100
N8 M30
%

  
Subprogram

O0002
N1 G91 G02 X5.20 Y3 R6  (Point C)
N2 G01 X3.12  (Point D)
N3 X16.02 Y10.23  (Point E)
N4 G03 Y10.11 R6  (Point F)
N5 G01 X-16.02 Y10.23  (Point G)
N6 X-3.12   (Point H)
N7 G02 X-5.20 Y3 R6   (Point I)
N8 M99



Friday, October 26, 2018

Macro Programming

macro programming is not duffer from the standard programming of CNC mill, its just used only some mathematical formulas and equations.

For macro programming learn you should have sound knowledge about the standard programming and good practical experience. The basic fundamental of macro is old G and M codes. There are nothing to new here i told only some kind of formulas are used.


In every new technologies the program get shorter and easy to use by operators. By the macro programming program gets shorten and flexible. The only one program held lot of data.

This macro condition i only used in fanuc advanced controller, i don't know others controller.

For the macro programming development there are basic three areas to understand

Variable: Stored value 
this is a main parameter of macro. Its stored the predefined value. In macro programming real data replaced by the variable


Logical Formulas: Looping
You might have heard that people of computer engineering are programming software applications or websites. Also know that If.....else is also used in it. Its called logical function.
For simple example: If I have a job I will call you. In this statement condition is i have job otherwise i will not call you. Such types of logic are used in macro for looping.

Function and constant: significant numbers
Function are used to calculate the formula and constant like basic math constant is л and its value is 3.14

The simple Program for macro is


%

O0001

N1 #100=500                ⇐ (Variable defined)
N2 #101=250                ⇐ (Variable defined)

N3 G0 G90 G54 X0 Y0
N4 Z10
N5 G01 Z0 F440
N6 Y50 F#101                                       ⇐ (Variable applied)
N7 G03 Y-50 I0 J-50 F#100                  ⇐ (Variable applied)
N8 Y50 I0 J50 F#101                            ⇐ (Variable applied)
N9 G01 Z50
N10 M30
%

Simulation of simple macro programming.



Thursday, October 25, 2018

Call Incremental Subprogram in Main Program

We saw how to call a drilling or tapping subprogram to the main program. Now how to input some complex program which is repeated by no. of time.

But what to do when we need to call a liner or a circular motion. When we need this we need to make subprogram in increment. To make a program in incremental system click here

You know very well that in incremental program system every motion origin is its previous position.

Here there are three slot in square plate, and slot dimension are same so that all liner movement will be same in incremental program.

Here we are making one sub program for only one square in incremental syatem and call it main program.





Main Program
%
O0001 (Main Program)
N1 G0 G91 G28 Z0
N2 G90 G54 X0 Y0 M03 S2000
N3 Z5
N4 G01 X25 Y25 F200
N5 M98 P0002  ⇐    (Call Subprogram)
N6 G01 G54 X60 Y60
N7 M98 P0002  ⇐    (Call Subprogram)
N8 G01 G54 X100 Y100
N9 M98 P0002  ⇐    (Call Subprogram)
N10 Z10 
N11 G0 G91 G28 Z0
N12 M05
N13 M30
%

Subprogram
%
O0002 (Sub Program)
N1 G91 G01 Z-5 F50
N2 X25
N3 Y25
N4 X-25
N5 Y-25
N6 Z5
N7 M99
%

Wednesday, October 24, 2018

Call Subprogram in Main Program M98 M99

When a predetermined coordinate has more than one type of operation, a subprogram is required. Subprogram is different from the Main program.

Subprogram is linked to the main program. Like, Drilling is compulsory for tapping operation.

Lets take an example by below fig.


Call Subprogram in Main Program 

In fig thre are five hole and each hole has 

Drilling  
Chamfering
Tapping

Conventional Program is

%
O0001
N1 G0 G91 G28 Z0
N2 M06 T1   (Drill 8.5mm)
N3 G90 G54  X20 Y20 M03 S1000 
N4 Z10
N5 G98 G81 X20 Y20 Z-25 R10 F40
N6 X80 Y20
N7 X80 Y80
N8 X20 Y80
N9 X50 Y50
N10 G80
N11 G0 G91 G28 Z0
N12 M5

N13 M06 T2   (Chamfer Tool)
N14 G90 G54 X20 Y20 M03 S300
N15 Z10
N16 G98 G81 X20 Y20  Z-3 R10  F10
N17 X80 Y20
N18 X80 Y80
N19 X20 Y80
N20 X50 Y50
N21 G80
N22 G0 G91 G28 Z0
N23 M5

N24 M06 T2   (Tapping M10 x 1.5)
N25 G90 G54 X20 Y20 M03 S30
N26 Z10
N27 G98 G84 X20 Y20 Z-24 R10 F45
N28 X80 Y20
N29 X80 Y80
N30 X20 Y80
N31 X50 Y50
N32 G80
N33 G0 G91 G28 Z0
N34 M5
N35 M30
%

The predefined cordinated are

X80 Y20
X80 Y80
X20 Y80
X50 Y50

We make a subprogram of predefined coordinate and set name of it is 1111 

O1111
N1 X80 Y20
N2 X80 Y80
N3 X20 Y80
N4 X50 Y50
N5 M98  ⇐    (Subprogram end)

Now the make a main program and call subprogram in main program.

%
O0001
N1 G0 G91 G28 Z0
N2 M06 T1   (Drill 8.5mm)
N3 G90 G54  X20 Y20 M03 S1000 
N4 Z10
N5 G98 G81 X20 Y20 Z-25 R10 F40
N6 M98 P1111  ⇐    (Call Subprogram)
N7 G80
N8 G0 G91 G28 Z0
N9 M5

N10 M06 T2   (Chamfer Tool)
N11 G90 G54 X20 Y20 M03 S300
N12 Z10
N13 G98 G81 X20 Y20  Z-3 R10  F10
N14 M98 P1111 ⇐    (Call Subprogram)
N15 G80
N16 G0 G91 G28 Z0
N17 M5

N18 M06 T2   (Tapping M10 x 1.5)
N19 G90 G54 X20 Y20 M03 S30
N20 Z10
N21 G98 G84 X20 Y20 Z-24 R10 F45
N22 M98 P1111 ⇐    (Call Subprogram)
N23 G80
N24 G0 G91 G28 Z0
N25 M5
N26 M30
%   


Note: another program named Subprogram should not be in storage


Advantages
  • No need to change in main program when some changes are occur.
  • Reduce editing time.
  • Increase productivity.
  • The program gets shorter.

Tuesday, October 23, 2018

Compensation G40 G41 G42

Everybody knows that any dimensions has tolerance. The dimensions are never without the tolerance. All dimensions has one higher value of it and one lower value of it.

Like this any cutter is also made from the manufacturing so cutter diameter is also not perfect it also has tolerance. For exaple if u buy 10mm of cutter diameter than its diameter is 9.999 to 10.00. It should be like this not exactly.

To get nearest value of machining we need some manipulation with cutter thats why wear word is include in cnc machine.



G40 G41 and G42 to be used for wear in cnc milling machine.

G41 left side cutter compensation
G42 Right side cutter compensation
G40 Cancel all compensation


G41 used for cutter moved towars left side if cutting direction is climb and cutter is right hand side tool for cutting.

G42 used for cutter moved toward right side if cutting direction is conventional and cutter is right hand side tool for cutting.

Cutter compensation used only for planner operation and it cant not used in 3D program.

Example of compensation

G0 G91 G28 Z0
G90 G54 G40 X0 Y0 ← (Cancel all previous compensation)
Z5
G01 Z0 F50
G41 Y100 ← (Left hand side tool compensation)
X200
Y0
X0
Z5
G0 G91 G28 Z0
M30

Sunday, October 21, 2018

Polar Coordinate G15 & G16

When any drill or tapping cycle circulating according to its radius circle, it's very difficult to find coordinate of each hole than Polar coordinate to be used. 

In Polar coordinate system the each hole automatically find its X and Y coordinate considering by given angle.


Polar Coordinate




In figure there are 6 hole are arranged in hexagonal manner from its center.

Its Pitch Circle Diameter is 100 than radius is 50.

Now the program will be...

N01 G0 G91 G28 Z0
N02 G90 G54 Y50 X0 M3 S1000
N03 Z50
N04 G98 G81 Z-15 R5 F50
N05 G16      ⇐ Polar Coordinate Start
N06 X50 Y60
N07 X50 Y120
N08 X50 Y180
N09 X50 Y240
N10 X50 Y300
N11 G15      ⇐ Polar Coordinate Off
N12 G0 G91 G28 Z0
N13 M5
N14 M30

Saturday, October 20, 2018

Comparison G90 and G91 Programming

Actually this post should be the first post of the CNC zone. As a new blogger i forget to say about this post. Well i think every cnc users know about G90 and G91 but here we discuss in brief. This is important to discuss because of further discussion about macro conditions and many more.

G90 is Absolute Coordinate system
G91 is Incremental Coordinate system

In G90 programming, all the values counted from predefined zero (origin) position.
In G91 programming, current position is zero for next position.

Lets take an example,



Absolute Program


N1 G0 G91 G28 Z0

N2 G90 G54 X20 Y20 M3 S2000
N3 Z5
N4 G01 Z0 F100
N5 X50
N6 Y45
N7 X75
N8 Y30
N9 X100
N10 Y80
N11 X75
N12 Y100
N13 X35
N14 Y69
N15 X20
N16 Y20
N17 Z5
N18 G0 G91 G28 Z0
N19 M30

Simulation of Absolute program





Incremental Program

N1 G0 G91 G28 Z0
N2 G90 G54 X20 Y20 M3 S2000
N3 Z5
N4 G01 Z-5 F100
N5 G91 X30
N6 Y25
N7 X25
N8 Y-15
N9 X25
N10 Y50
N11 X-25
N12 Y20
N13 X-40
N14 Y-31
N15 X-15
N16 Y-49
N17 Z5
N18 G0 G91 G28 Z0
N19 M30

Simulation of Incremental program









Thursday, October 11, 2018

Canned Cycle: Tapping

Tapping is most common word for industrial use. Tapping is crucial parameter of production line system. The tap is used for the tapping. Tapping means make a thread in to the hole.





Generally small to medium size of tap available in market. For any special size or any higher size according to the pitch of threading thread mill to be used.

For the tapping, you have to knowledge about pitch and TPI. So, the new word is pitch and TPI ...Now, What is pitch?, The pitch defined as the center distance between two nearby thread, 

Now, What is TPI?, TPI means thread per inches. In the picture below you will understand exactly.






From shown into the fig the total length of thread is 25.4mm and pitch is 1.5mm, So the total thread per inch 

25.4 / 1.5 = 16.93 ≈ 17 TPI



Now, tapping cycle based on the pitch, without breaking a tap tapping needs relation between RPM, given feed and Tap pitch. Here the relation of 

Feed = RPM x Pitch


If your pitch is 1.5mm and RPM is 30 than feed must be 45 mm/min, if you change the feed without consideration of pitch and RPM, The tap gets broken. The format of tapping cycle like a drill cycle, just G83 replaced by G84.

For the tapping make hole first, According to the thread, there are many standards available. It gets differ by its standard, here are some data of standard for general use.

            G98  G84 X....Y....R....Z....Q....F....



Example of Tapping M10 x 1.5 Tap






N100 G0 G91 G28 Z0
N102 G0 G90 G54 X15 Y25 M03 S30 
N104 Z50
N106 G98 G84 X15 Y25 R5 Z-10 Q3 F45
N108 X50 Y40
N110 X60 Y20
N112 G80
N114 G0 G91 G28 Z0
N116 M05
N118 M30

Rigid tapping does not need a Peck its go throughout to the hole without pecking. Its depends on material types of TAP and workpiece. 

This program has no need to simulation. Its simulation like drill program. You can view here

Thank you



Wednesday, October 10, 2018

Canned Cycle: Peck Drill


In drill operation when L/D ratio is very high or Depth of hole is greater than flute length of drill than peck drill to be used


Drill pecks in the peck drill operation in defined depth off period. Due to this chip is continuously. Peck of drill chip is continuously away from from the hole due to this reduces breakage chances.




Example of Peck Drill

Format of Peck Drill

G98 G83 X....Y....R....Z....Q....F....

In this format Q indicates the incremental depth of each peck and parameter i explained in my previous post





N100 G0 G91 G28 Z0
N102 G0 G90 G54 X15 Y25 M03 S1000 
N104 Z50
N106 G98 G83 X15 Y25 R5 Z-10 Q1 F20
N108 X50 Y40
N110 X60 Y20
N112 G80
N114 G0 G91 G28 Z0
N116 M05
N118 M30

Here the simulation of Peck Drill