Search This Blog

Showing posts with label cnc Programming. Show all posts
Showing posts with label cnc Programming. Show all posts

Saturday, November 15, 2014

Why G04 Dwell Command used in CNC Programming

G-Code G04 Dwell Command.

G-CODE FORMAT:  

N_G04 X2.0 (Excluding fixed cycle)
N_G04 P2000 (including fixed cycles)
N_G04 U2.0   (only for lathes)
(1 S= 1000 milliseconds)

 Description:
G04 G-code is a Dwell command which may also call as pause in the program, the time period specified in the program any axis can be stopped without affecting the other commands and functions. Dwell during the cut is mainly used for breaking chips in the drilling and counter boring. Dwell can also be used in turning and boring to eliminate the physical marks left on end of the cutting tool.

Calculating dwell:
Minimum dwell is the time required to complete one revolution of the spindle.   

Minimum Dwell (sec) = 60/r/min

For example, calculating Dwell for 600 spindle revolution, divide 60 by r/min I.e, 60/600=0.1seconds.

Calculating Dwell Sec:
Dwell sec = 60 x N / RPM
Where     60 = Number of minutes.
                N= Number of spindle rotations.
                RPM= current spindle speed.
Example: Dwell sec=60 X 3/600 = 0.3

Calculating Dwell Sec:
Dwell rev = RPM x Dwell sec/ 60

Example: Dwell rev = 600 X 0.3 /60 =3 rev
  
Note:
1.        The G04 code is not a modal g-code.
2.        Dwell command is always completed before the next operation begins.
3.       The actual time specified in dwell is either seconds or milliseconds.
4.       Dwell can also be used in the fixed cycles together with cycle data, not in a separate block.
5.    When using Dwell no axis motion will takes place.
6.      Fixed cycles like G76, G82, G88, and G89 in which dwell can be used.
7.     Cycles like G84 and G74 Dwell can be used only by parameter setting. Example:

Example:

N170 G90 G0 Z5
N171 G82 X12 Y6 R2 Z-4 P300 F100 (Dwell command 0.3 seconds)





Thursday, November 13, 2014

"What is M02 & M30 (Program End) M-CODE in CNC Programming"

M-Code M02-M30 (Program end).

M02 (Program End without program reset):
The M02 code is used to end a program. But the Program won’t reset to the begining of the program for the next cycle. The Operator has to manually reset the program if M02 is used.

M30 (Program End with program reset):

The most common way of ending a program is with an M30. The program will automatically reset to the begin of the program which will give access to the operator to run the next cycle. Using M30 will help operator to save time during mass production. As soon as the program ends he can place the next component and start the next cycle.

Example for M30 and M02:

N170 M05                                (Spindle OFF)
N171 M09                                (Coolant OFF)
N172 G91 G28 X0 Y0 Z0;        (Return to Home Position)
N173 M30 (or M02)                 (End Program and Reset)

Note: Returning completely to the Home position is waste of time during mass productions. So returning the Z to home position is actual practice since any way it will rest for the tool change in the beginning. And move the table near the operator to Fixture the next part as shown in below example.

N170 M05                    (Spindle OFF)
N171 M09                    (Coolant OFF)
N172 G91 G28 Z0;      (Return to Home Position)
N173 G90 X100 Y-100            (Move table near to Operator)

N173 M30 (or M02)     (End Program and Reset)

"What is M00-M01 (Optional stop) M-CODE in CNC Programming"


M-Code M00-M01 (Optional stop):

The M00 code is used to stop a program. When the controller reads M00 in the program, it stops all the axes, spindle, turns off the coolant (including Through Spindle Coolant). In The next block after the M00 will be highlighted when viewed in the program editor so you can insert a comment for operator what to do when M00 Called. For example, comment to clean the chips or check the tool etc. Pressing Cycle Start button will continue program operation from the highlighted block after the operator has confirmed the note inserted.

M01 works the same as M00, except the Optional Stop button the machine control board must be on.
If no Optional Stop button is OFF on the controller board, then the machine will not stop when it reads M01.

NOTE: If anything very Important to stop the machine while program execution it is better to use M00 instead ofM01. Since if operator forgets to put ON the Optional stop Button then also the machine will stop at M00.

Example Program M00:


N170 G0 Z10.0
N171 M05 (Spindle Off)
N172 M00 (Clean the Chips)
N173 M03 S3000 (Turn ON the spindle)

Example Program M01:

N170 T6 M06
N171 G43 H6 (Call Tool Length offset)
N172 M01 (Check the tool for damage) (If operator has put new tool he may not switch ON Optional stop Button)
N173 M03 S3000 (Turn ON the spindle)

APT Command to insert in Your Program = STOP

"How the Block delete Command works on CNC Programming"

"How the Block delete Command works on CNC Programming"

Block delete (/):

Block delete is used in a program by placing a forward slash (/) at the beginning of the line.  It is a useful function which allows the operator to skip the blocks within the program. Block delete will not actually delete the blocks in the program but the block will be still there and those blocks will be ignored by the controller.
Block delete works same as Optional stop M01, so operator has to switch ON the Block delete switch on the control board, so controller will skip the blocks which are marked with forward slash (/) symbol in the beginning of the line or block. If the Operator forgets to Switch ON the Block delete Button then the Blocks marked with forward slash (/) symbol in the beginning of the line or block will be executed normally by the controller.

Example: In the example show below is the same program segment for two similar parts, except the part B has the addition of drilling holes.

Part A:  3 position of drilling holes (With Block delete ON in controller)
Part B:  6 Position of drilling holes. (With Block delete OFF in controller)

Program:

N170 G80 X0 Y10 Z-10 R02 F50
N171 X0 Y20
N172 X0 Y30
/N173 X10 Y10 (Used only for part B)
/N174 X10 Y20 (Used only for part B)
/N175 X10 Y30 (Used only for part B)

N176 M05

Thursday, June 26, 2014

"What's G02-G03 G-code Circular interpolation"


G-C0de G02 and G03 Circular Interpolation.

IN CNC Programming G02 and G03 plays a major role for the circular tool movement along the planar axis.

G-CODE FORMAT:          

                                                N G02 X_ Y_ R_F;

                                                N G02 X_ Y_I_J_F;

                                                N G03 X_Y_R_F;

                                                N G03 X_ Y_I_J_F;

                Where as,

                        G02 - Clockwise circular cutting movement.

G03 - Anti-clockwise circular cutting movement.

X-Y_ - defines the arc end point in the work co-ordinate system.

R - Defines the length of the arc radius.

I_ J_ - Defines the distance of the arc start point from the centre point of the arc.

F_- Defines the feedrate along the arc movement.



Description:


·         The G-Code G02 Defines the clockwise circular cutting movement at a set feed rate.

·         The G-Code G03 Defines the Anti-clockwise circular cutting movement at a set feedrate.

·         I and J used in the program relates to the distance in X and the Y axis.

·         I relates to X Axis direction (+/-) from the start point of the arc to the arc centre as shown in below diagram.

·         J relates to Y Axis direction (+/-) from the start point of the arc to the arc centre as shown in below diagram.

·         The axis of the circle or helix must be parallel to the X-, Y- or Z-axis of the machine coordinate system




Note:

1.       When Programming arc using the Radius R the value of R must be equal or greater than the half longest distance along axis.
2.       I0 and J0 in any program lines can be omitted.
3.       G02 G-Code can be written in Two ways G02 or G2
4.        G03 G-Code can be written in Two ways G03 or G3

Example G02 Using I and J vectors:                          Example G02 Using Arc Radius:

G00 X0 Y0 Z50                                                                    G00 X0 Y0 Z50                    (POINT A)
G01 Z0 F50                                                                          G01 Z0 F50                         
X10 Y10                                                                                 X10 Y10                               (POINT B)
Y50                                                                                         Y50                                       (POINT C)
X40                                                                                         X40                                        (POINT D)
G02 X50 Y40 I0 J-10                                                          G02 X50 Y40 R10                 (POINT E)
G01 Y20                                                                                G01 Y20                                (POINT F)
G02 X40 Y10 I-10 J0                                                          G02 X40 Y10 R10                   (POINT G)
G01 X10                                                                                G01 X10                                (POINT B)

Example G03 Using I and J vectors:                          Example G02 Using Arc Radius:

G00 X0 Y0 Z50                                                                    G00 X0 Y0 Z50                    (POINT A)
G01 Z0 F50                                                                         G01 Z0 F50                         
G01 X10 Y10                                                                       G01 X10 Y10                   (POINT B)           
X40                                                                                       X40                                       (POINT C)
G03 X50 Y20 I0 J10                                                            G03 X50 Y20 R10               (POINT D)
G01 Y40                                                                                G01 Y40                              (POINT E)
G03 X40 Y50 I-10 J0                                                          G03 X40 Y50 R10               (POINT F)
G01 X10                                                                                G01 X10                              (POINT G)
Y10                                                                                         Y10                                      (POINT B)
If any query, please comment or contact me