unique g codes
TRANSCRIPT
-
7/30/2019 Unique G Codes
1/28
HAAS UNIQUE G-CODES
-
7/30/2019 Unique G Codes
2/28
G12/13 - CIRCULAR POCKET MILLING
G51 - SCALING
G53 - NON-MODAL MACHINECOORDINATE SYSTEM
G68 - ROTATION
G101 - MIRROR IMAGE G150 GENERAL PURPOSE POCKET
MILLING
UNIQUE MILL G-CODES
-
7/30/2019 Unique G Codes
3/28
OVERVIEW
Description of Codes
Code Format Effects of Settings
Unique Features
Examples
-
7/30/2019 Unique G Codes
4/28
-
7/30/2019 Unique G Codes
5/28
G12/G13-CIRCULAR
POCKET MILLING (cont)
G12 and G13 are Non-modal Cutter Compensation is included
in this routine Use D00 to ignore tool offset Use I without K and Q for small
pockets or holes When using K and Q, only K
should be the radius of thedesired finished pocket
Position cutter in a previousblock or add an X and Y to theG12/G13 line
-
7/30/2019 Unique G Codes
6/28
G12 Example using I
(Finished Radius)
O0010 ;
T1 M06 ;
G90 G54 G00 X1.0 Y1.0 ;
S1500 M03 ;
G43 Z0.1 H1 M08;
G12 Z-0.5 I0.4 D01 F15. ;
G00 Z0.1 M09 ;
G28 G91 Y0 Z0 ;
M30 ;
Only one pass is required for
this example, so there is only
an I value (circle radius) in the
G12 line. G12 will use
conventional rather thanclimb millin
We want to mill a 0.8 diameter
0.5 deep pocket using a 0.5
endmill. The picture shows the
tool path for the code given.
-
7/30/2019 Unique G Codes
7/28
G13 Example
using I, K, Q
O0010 ;T1 M06 ;G90 G54 G00 X1.0 Y1.0 ;S1500 M03 ;G43 Z0.1 H1 M08;G12 G91 Z-0.5 I0.3 K1.5 Q0.3
D01 F15. L3;G90 ;G00 Z0.1 M09 ;G28 G91 Y0 Z0 ;M30 ;
This example requires more
passes in both the radius and
depth so K, Q and L (and a
G91) are used in addition to I.
We want to mill a 3.0 diameter
1.5 deep pocket using a 0.5endmill.
As seen in the picture, the first pass
is the I value (0.3). Additional
passes of Q increments (also 0.3) are
made until the full radius (K1.5) is cut.
Then the tool will move down in Z
another 0.5 and repeat the process.
The G13 cycle will repeat three times(L3) to produce a depth of 1.5
-
7/30/2019 Unique G Codes
8/28
G51-SCALING
Used to proportionally increase ordecrease X, Y, Z, I, J, K, or Rvalues in subsequent lines ofcode
G51 [X] [Y] [Z] [P] X - Optional X-axis center of scalingY - Optional Y-axis center of scaling Z - Optional Z-axis center of scaling P - Optional scaling factor, 3 place
decimal from 0.001 to 8383.000 With G51, you can easily create
different size parts by justchanging the P value.
G50 - Cancel ScalingThis is an optional feature along with G68 - Rotation.
-
7/30/2019 Unique G Codes
9/28
G51-SCALING(cont)
Setting 71- If P is not used, Setting 71is the default scaling factor. G51 X1. 5 Y1.0 (Scaling center is at X1.5,
Y1.0 and the scale factor is determined bySetting 71)
If X, Y, or Z are not used, the currentwork coordinate is used as thescaling center G00 X1.0 Y2.0
G51 P2. (Scaling center is at X1.0, Y2.0with a scale factor of 2.)
The factory default for setting 71 is 1.0,
meaning no scaling would take place.
-
7/30/2019 Unique G Codes
10/28
G51-SCALING(Example)
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;
G51 P2. ; (Scale factor of 2.)M97 P10 ;G28 G91 Y0 Z0 ;M30 ;N10 G00 X1. Y1. ;G01 Z-0.5 F15. ;X2. F20. ;Y2. ;G03 X1. R0.5 ;G01 Y1. ;G00 Z0.1 ;M99 ;
(Originalgeometry)
Take geometry shown by dashed line and
double the size. Use the original work
coordinate origin as the scaling center.
= Work coordinate origin= Center of scaling
Z values will also be doubled, sodepth of pocket will be -1.0.
-
7/30/2019 Unique G Codes
11/28
G51-SCALING(Example 2)
O0010 ;
T1 M06 ;
G54 G90 G00 X0 Y0 ;
G43 Z0.1 H1 ;
S500 M03 ;
G51 X1.5 Y1.5 P2.;M97 P10 ;
G28 G91 Y0 Z0 ;
M30 ;
N10 G00 X1. Y1. ;
G01 Z-0.5 F15. ;X2. F20. ;
Y2. ; G03 X1. R0.5 ;
G01 Y1. ;
G00 Z0.1 ;
M99 ;
(Originalgeometry)
Take geometry shown by dashed line and
double the size. Use a different work
coordinate as the scaling center.
= Work coordinate origin= Center of scaling
(Scaling centerX1.5 Y1.5)
-
7/30/2019 Unique G Codes
12/28
-
7/30/2019 Unique G Codes
13/28
G53-NON-MODAL
COORDINATE SYSTEM
Cancels existing work coordinatesystem
Can be used to return spindle ortable to machine zero G53 Y0. Moves table to machine zero in Y
Must be used with a G49 if you havea Z value (G49 cancels tool offset)
G53 G49 Z0. Returns spindle to machine zero
An alternative to G28 G91 Z0; With G28 you must remember to add a
G90 afterwards
With G53 you stay in G90 modeThis is a standard feature.
-
7/30/2019 Unique G Codes
14/28
-
7/30/2019 Unique G Codes
15/28
G68-ROTATION(cont)
Setting 72 - If R is not included inthe G68 line, Setting 72 is thedefault angle of rotation
Setting 73 - Must be on to have therotational value incrementallychange in G91 mode
Can be combined with Scaling -
Scaling should be activated first Cutter Comp should be turned on
after G51 or G68 commands andturned off before G50 and G69.
The factory default of Setting 72 is 0.0.
-
7/30/2019 Unique G Codes
16/28
G68 - ROTATION
(Example)
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;M97 P10 L8;
G69 M09 ;G28 G91 Y0 Z0 ;M30 ;N10 G91 G68 X0 Y0 R45. ;G90 ;G00 X1. Y1. Z0.1 ;G01 Z-0.5 F15. M08 ;
X2. F20. ;Y2. ;G03 X1. R0.5 ;G01 Y1. ;G00 Z0.1 ;M99 ;
We will take one of the arched windows
and rotate it around the origin in 45
degree increments.
= Work coordinate origin
= Center of scaling
(Windowgeometry)
By altering the L and R in the underlined blocks you can varythe number of windows cut.
(Rotate 45)
(Pocket routine is
done 8 times.)
-
7/30/2019 Unique G Codes
17/28
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;M97 P10 L6;
G69 M09 ;G28 G91 Y0 Z0 ;M30 ;N10 G91 G68 X0 Y0 R60. ;G90 ;G00 X-0.4911 Y2.9062 ;G01 Z-0.5 F15. M08 ;
G02 X0.4911 Y2.9062 I0.4911 J0.0938;G01 X0.1228 Y0.9774 ;G02 X-0.1228 Y0.9766 I-0.1228 J0.0234;G01 X-0.4911 Y2.9062G00 Z0.1 ;M99 ;
We will take a pocket that is
uniform around the X-axis, and
rotate it around the origin in 60
degree increments.
= Work coordinate origin
= Center of scaling
(Pocketgeometry)
Note that in this and the last example we included an X and Y inthe G68 line to define the center of rotation.
(Rotate 60)
G68 - ROTATION(Example 2)
-
7/30/2019 Unique G Codes
18/28
G101-MIRROR IMAGE
Used to produce a mirror image of a
sequence of codes around an X, Y,
Z, A or B axis
G101 [X] [Y] [Z] [A] [B]
At least one axis must be specified
Any value given will be ignored
G100 cancels mirror image
You can mirror image more than one axis at a time.
This is an standard control feature.
-
7/30/2019 Unique G Codes
19/28
Setting 45 - Mirror image X-axis Setting 46 - Mirror image Y- axis
Setting 47 - Mirror image Z-axis
Setting 48 - Mirror image A-axis
Setting 80 - Mirror image B-axis
These settings activate mirrorimaging without using G101
If only one axis is mirrored, climbmilling will be changed toconventional milling (i.e. direction oftravel will be reversed). Cutter
compensation is also reversed.When you use these settings, mirror imaging will be
active until you manually turn the settings off.
G101-MIRROR IMAGE(cont)
-
7/30/2019 Unique G Codes
20/28
G101-MIRROR IMAGE(Example)
In this example, we will mirrorthe Pocket on the right in the X-
axis, producing a similar pocket
on the left.
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;M97 P20 ;N10 G101 X0 ;
M97 P20 ;G100 ;G00 Z0.1 ;M09 ;G28 G91 Y0 Z0 ;M30 ;N20 G00 X-0.4653 Y0.052 ;G01 Z-0.5 F15. M08 ;
G01 X-1.2153 Y0.552 ;G03 X-1.3059 Y0.528 R.0625 ;G01 X-1.5559 Y0.028 ;G03 X-1.5559 Y-0.028 R.0625 ;G01 X-1.3059 Y-0.528 ;G03 X-1.2153 Y-0.552 R.0625 ;G01 X-0.4653 Y-0.052 ;G03 X-0.4653 Y0.052 R.0625 ;M99 ;
Because the pocket is symmetrical around the
X-axis, we could add a Y0 in line N10 and not
change the part. This would allow us to ClimbMill on the second pocket as well as the first.
(Pocketgeometry)
-
7/30/2019 Unique G Codes
21/28
G101-MIRROR IMAGE(Example 2)
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;M97 P10 ;N10 G101 Y0 ; (Mirror in Y-axis)M97 P20 ;G28 G91 Y0 Z0 ;M30 ;N20 G00 X2. Y2. ;G01 Z-0.5 F15. ;X4. F20. ;Y4. ;G03 X2. R1. ;G01 Y2. ;G00 Z0.1 ;M99 ;
(Originalgeometry)
In this example, we will mirror the pocket
on top, in the Y-axis, producing a similar
pocket on the bottom.
In this example, Climb Milling on the first pocket is changed
to Conventional on the second pocket.
-
7/30/2019 Unique G Codes
22/28
G101-MIRROR IMAGE(Example 3)
O0010 ;T1 M06 ;G54 G90 G00 X0 Y0 ;G43 Z0.1 H1 ;S500 M03 ;M97 P10 ;N10 G101 Y0 X0; (Mirror in X-M97 P20 ; and Y- axes)G28 G91 Y0 Z0 ;M30 ;N20 G00 X2. Y2. ;G01 Z-0.5 F15. ;
X4. F20. ;Y4. ;G03 X2. R1. ;G01 Y2. ;G00 Z0.1 ;M99 ;
If we add an X0 to line N10, it will
produce results shown above.
Climb Milling will also take place
on the second pocket.
-
7/30/2019 Unique G Codes
23/28
G150-POCKET MILLING
Used to mill a pocket by defining only theoutside shape of the pocket
G150 G41* P F D I J K Q RX Y Z [L] [S] P - Number of Sub-program defining pocket(required)
F - Feedrate D - Tool diameter offset selection
I - X-axis cut increment (I or J is required)
J - Y-axis cut increment
K - Finish cut allowance
Q - Incremental Z-axis cut depth per pass (>0) (reqiuired) R - R plane position (required)
X & Y - Position of starting hole
Z - Final depth of pocket
L - Optional repetition count for additional pockets
S - Optional spindle speed* G42, Cutter Comp Right, is also permissibleThis is an standard control feature.
-
7/30/2019 Unique G Codes
24/28
-
7/30/2019 Unique G Codes
25/28
G150-POCKETMILLING (cont)
There is no finishing pass in the Z depth.
Q is a positive value for the amount ofincremental step down in Z for deeper pockets.
You cannot use both I and J. If you use L for additional pockets, you must have
a G91 and incremental positioning in the G150line You will also need to drill all your clearing holes prior to
the G150 line
The finishing pass, K, is taken at the full depth (Z)of the pocket.
It is also possible to program an island within apocket. (See the Operators Manual for an example ofthis.)
You can not use a G68 with G150
-
7/30/2019 Unique G Codes
26/28
G150-POCKET MILLING(Example)
In this example, we will mill the pocket
shown using steps along the X-axis of
0.3(I). We will take a maximum depth
of cut of 0.2(Q). (The first pass will
only be 0.1). We will leave 0.02(K) for
a finishing pass. The geometry is in
program number O0200(P)
O0010 ;T1 M06 ;G54 G90 G00 X3.0 Y3.5 ;G43 Z0.1 H1 ;S2500 M03 ;N10 G81 Z-0.5 R0.1 F25. ;T2 M06 ;G43 Z0.1 H2 ;S2000 M03 ;G150 P200 G41 X3.0 Y3.5 Z-0.5 F30. R0.1Q0.2 I0.3 K0.02 ;G00 Z0.1 M09 ;G28 G91 Y0 Z0 ;M30 ;
O0200 ;G01 X2.0 ;Y2.0 ;X4.0 ;
Y4.0 ;G03 X2.0 Y4.0 R1.0 ;G01 Y3.5 ;M99 ;
(Sub-program forPocketgeometry)
Notice that there is a drill cyclein line N10 for a clearing hole.
-
7/30/2019 Unique G Codes
27/28
Visit our web site,
http://www.haascnc.com/training
to view Information Modules on
other features of the Haas
Control. You can also download
training booklets on the Haas
Control and CNC Programming.
-
7/30/2019 Unique G Codes
28/28