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.